
/* the logo animation's own lavender; on wide screens the page carries on the video's edge shading */
:root{ --intro-bg:#E2D5FA;
  --intro-edge:linear-gradient(180deg,#E1D4F9 0%,#E0D3FA 4.2%,#DDD0F7 8.3%,#DBCDF9 12.5%,#D9CBF7 16.7%,#D8C6F6 20.8%,#D8C6F6 25%,#D7C7F6 29.2%,#D6C6F6 33.3%,#D9CAF6 37.5%,#DACCF7 41.7%,#DDCCF8 45.8%,#DBCCF7 50%,#DACBF8 54.2%,#DBCCF8 58.3%,#D9CCF8 62.5%,#DACAF6 66.7%,#D9C9F7 70.8%,#D9CBF7 75%,#D9CBF7 83.3%,#DBCDF7 87.5%,#DED1F8 91.7%,#E0D3FA 95.8%,#E1D4F9 100%); }
#otzIntro{ display:none; }
html.otz-intro #otzIntro{ display:block; position:fixed; inset:0; z-index:2147483000;
  background:var(--intro-bg); cursor:pointer; touch-action:none; transition:opacity .3s ease; }
html.otz-intro #otzIntro.out{ opacity:0; pointer-events:none; }
#otzIntro .otz-intro-box{ position:absolute; inset:0; }
#otzIntro video{ position:absolute; inset:0; width:100%; height:100%; display:block; object-fit:cover; object-position:50% 50%; background:transparent; border:0; }
#otzIntro video.off{ opacity:0; }
/* tablets on their side and computers: the whole portrait frame, full height, its edges carried on across the screen */
@media (min-aspect-ratio: 3/4){
  html.otz-intro #otzIntro{ background:var(--intro-edge); }
  #otzIntro video{ object-fit:contain;
    -webkit-mask-image:linear-gradient(90deg,transparent calc(50% - 28.125vh),#000 calc(50% - 27vh),#000 calc(50% + 27vh),transparent calc(50% + 28.125vh));
    mask-image:linear-gradient(90deg,transparent calc(50% - 28.125vh),#000 calc(50% - 27vh),#000 calc(50% + 27vh),transparent calc(50% + 28.125vh)); }
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:#f2f2f7;
  --surface:#ffffff;
  --surface2:#f2f2f7;
  --surface3:#e8e8ed;
  --ink:#1d1b18;
  --ink2:#6c6c70;
  --ink3:#aeaeb2;
  --border:rgba(60,60,67,0.1);
  --accent:#5e3de8;
  --accent2:#7c5fe8;
  --accent-light:rgba(94,61,232,0.08);
  --accent-mid:rgba(94,61,232,0.15);
  --oc:#0071e3; --yd:#1c8a2e; --cm:#7a3bc4; --ae:#bf4800; --hk:#6c6c70;
  --radius:16px;
  --shadow-sm:0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg:0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --aos:#5e3de8;
  --aos2:#7c5fe8;
  --aos-light:rgba(94,61,232,0.08);
  --aos-mid:rgba(94,61,232,0.15);
  --soc:#7c5200;
  --soc2:#a06c00;
  --soc-light:rgba(124,82,0,0.07);
  --soc-mid:rgba(124,82,0,0.13);
  --soc-border:rgba(124,82,0,0.12);
  --str:#8b4513;
  --str2:#a0522d;
  --str-light:rgba(139,69,19,0.08);
  --str-mid:rgba(139,69,19,0.14);
  --his:#0f8a78;
  --his2:#13a692;
  --his-light:rgba(15,138,120,0.08);
  --his-mid:rgba(15,138,120,0.15);
  --shtz:#a9791b;
  --shtz2:#c79a3e;
  --shtz-light:rgba(169,121,27,0.08);
  --shtz-mid:rgba(169,121,27,0.16);
  --kab:#2456c9;
  --kab2:#3f74e6;
  --kab-light:rgba(36,86,201,0.08);
  --kab-mid:rgba(36,86,201,0.15);
  --fav:#dca400;
  --fav-light:rgba(220,164,0,0.10);
  --fav-mid:rgba(220,164,0,0.22);
  --mn:#c2456e;
  --mn2:#d76a8c;
  --mn-light:rgba(194,69,110,0.08);
  --mn-mid:rgba(194,69,110,0.15);
  --cn:#c2410c;
  --cn2:#e2622a;
  --cn-light:rgba(194,65,12,0.08);
  --cn-mid:rgba(194,65,12,0.16);
  --yh:#047857;
  --yh2:#059669;
  --yh-light:rgba(4,120,87,0.08);
  --yh-mid:rgba(4,120,87,0.16);
  --mb:#3f6b8c;
  --mb2:#5586a8;
  --mb-light:rgba(63,107,140,0.08);
  --mb-mid:rgba(63,107,140,0.16);
  --sim:#c77a12;
  --sim2:#e0912a;
  --sim-light:rgba(199,122,18,0.09);
  --sim-mid:rgba(199,122,18,0.16);
  --pw:#0e7490;
  --pw2:#1290ad;
  --pw-light:rgba(14,116,144,0.09);
  --pw-mid:rgba(14,116,144,0.16);
  --tc:#3b3d8c;
  --tc2:#565ab3;
  --tc-light:rgba(59,61,140,0.09);
  --tc-mid:rgba(59,61,140,0.16);
  /* Stronger fill + outline for the Chatzos calculator: a 9% tint disappears
     against a white card, so its result boxes and chips get their own tokens. */
  --tc-fill:rgba(59,61,140,0.13);
  --tc-line:rgba(59,61,140,0.38);
  --ym:#8a3b52;
  --ym2:#a85572;
  --ym-light:rgba(138,59,82,0.08);
  --ym-mid:rgba(138,59,82,0.16);
  --gc:#0e7490;
  --gc2:#1594b5;
  --gc-light:rgba(14,116,144,0.08);
  --gc-mid:rgba(14,116,144,0.16);
  --lib:#6b4423;
  --lib2:#8a5a30;
  --lib-light:rgba(107,68,35,0.08);
  --lib-mid:rgba(107,68,35,0.16);
}
html[data-dark] body { background:var(--surface-2); }
html[data-dark] .hero {
  background:linear-gradient(160deg,#1a1726 0%,#1e1a30 40%,#1a2040 100%);
}
html[data-dark] .hero::before {
  background:radial-gradient(ellipse 80% 60% at 50% -10%,rgba(94,61,232,0.3) 0%,transparent 70%);
}
html[data-dark] .hero h1 {
  background:linear-gradient(135deg,#a78bfa 0%,#c4b5fd 50%,#e0d9ff 100%);
  -webkit-background-clip:text;background-clip:text;
}
html[data-dark] .hero-sub,html[data-dark] .hero-eyebrow { color:var(--ink-3); }
html[data-dark] .daily-banner {
  background:linear-gradient(135deg,#1e1b2e 0%,#231d3a 50%,#1a2040 100%);
  border-color:rgba(94,61,232,0.2);
}
html[data-dark] .daily-card {
  background:rgba(44,44,46,0.85);
  border-color:rgba(255,255,255,0.1);
}
html[data-dark] .daily-card-label { color:var(--ink-3); }
html[data-dark] .daily-card-main { color:#f2f2f7; }
html[data-dark] .daily-card-sub  { color:#aeaeb2; }
html[data-dark] .daily-card-sub-en { color:var(--ink-3); }
html[data-dark] .daily-explore-btn {
  background:rgba(94,61,232,0.25);color:#c4b5fd;border-color:rgba(94,61,232,0.35);
}
html[data-dark] .search-bar {
  background:rgba(28,28,30,0.94);
  border-bottom-color:rgba(255,255,255,0.08);
}
html[data-dark] .search-inner input {
  background:var(--surface-2);color:#f2f2f7;
}
html[data-dark] .toggle-wrap {
  background:rgba(44,44,46,0.92);
  border-color:rgba(94,61,232,0.25);
}
html[data-dark] .toggle-btn:not(.active) { color:var(--ink-3); background:transparent; }
html[data-dark] .toggle-btn:not(.active):hover { background:var(--accent-light); color:var(--accent); }
html[data-dark] .filter-btn:not(.active) {
  background:var(--surface-2);color:var(--ink-3);border-color:rgba(255,255,255,0.1);
}
html[data-dark] .sec-btn:not(.active) {
  background:var(--surface-2);color:var(--ink-3);border-color:rgba(255,255,255,0.1);
}
html[data-dark] .lh-view-btn:not(.active) {
  background:var(--surface-2);color:var(--ink-3);border-color:rgba(255,255,255,0.12);
}
html[data-dark] .aos-depth-btn:not(.active) {
  background:var(--surface-2);color:#a78bfa;border-color:rgba(139,92,246,0.3);
}
html[data-dark] #scrollTopBtn {
  background:var(--surface-2);color:#f2f2f7;border-color:rgba(255,255,255,0.12);
}
html[data-dark] .dark-toggle-btn {
  background:rgba(44,44,46,0.85);color:#c7c7cc;border-color:rgba(255,255,255,0.15);
}
.dark-toggle-btn {
  position:fixed;top:14px;right:16px;z-index:9999;
  width:38px;height:38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-size:1.15rem;line-height:1;
  border:1.5px solid rgba(94,61,232,0.18);
  background:rgba(255,255,255,0.82);
  cursor:pointer;
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  transition:all 0.2s;box-shadow:0 2px 8px rgba(0,0,0,0.10);
  padding:0;
}
html[data-dark] .no-results { color:var(--ink-3); }
html { scroll-behavior:smooth; }
body { font-family:var(--font-ui);
  background:var(--bg); color:var(--ink); min-height:100vh; direction:rtl; -webkit-font-smoothing:antialiased; }

/* ── HERO ─────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #faf9ff 0%, #f0edff 40%, #e8f4ff 100%);
  text-align:center; padding:4rem 1.5rem 2.8rem;
  border-bottom:1px solid rgba(94,61,232,0.1);
  position:relative; overflow:hidden;
}
.hero::before {
  content:''; position:absolute; inset:0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(94,61,232,0.12) 0%, transparent 70%);
  pointer-events:none;
}
.hero-eyebrow {
  font-size:max(12px,0.72rem); font-weight:600; letter-spacing:0.15em; color:var(--accent);
  text-transform:uppercase; margin-bottom:1rem; direction:ltr;
}
.hero h1 {
  font-size:clamp(2rem,5.5vw,3.4rem); font-weight:900; line-height:1.5;
  letter-spacing:-0.02em; padding-bottom:0.15em;
  background: linear-gradient(135deg, #2d1b8a 0%, #5e3de8 45%, #9b6dff 100%);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.hero-sub { font-size:1rem; color:var(--ink2); margin-top:0.75rem; font-weight:400; direction:ltr; }

/* ── TOGGLE ───────────────────────────────────────────────────────────── */
.mode-toggle { display:flex; justify-content:center; margin-top:2rem; width:100%; }
.toggle-wrap {
  display:inline-flex; flex-wrap:wrap; justify-content:center; align-items:center;
  background:rgba(255,255,255,0.7);
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  border-radius:28px; padding:4px; gap:2px; row-gap:4px;
  border:1px solid rgba(94,61,232,0.15);
  box-shadow:0 2px 12px rgba(94,61,232,0.1), 0 1px 3px rgba(0,0,0,0.06);
  max-width:calc(100% - 2rem);
}
.toggle-btn {
  font-family:inherit; font-size:0.82rem; font-weight:500; padding:0.55rem 1.1rem;
  border:none; border-radius:980px; background:transparent; color:var(--ink2);
  cursor:pointer; transition:all 0.2s; white-space:nowrap; text-align:center; line-height:1.25;
}
.toggle-btn.active {
  background:var(--accent); color:var(--on-accent);
  box-shadow:0 2px 8px rgba(94,61,232,0.35);
}
.toggle-btn:not(.active):hover { background:var(--accent-light); color:var(--accent); }

/* ── SEARCH BAR ───────────────────────────────────────────────────────── */
.search-bar {
  position:sticky; top:0; z-index:200;
  background:rgba(242,242,247,0.88);
  backdrop-filter:saturate(180%) blur(20px); -webkit-backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid var(--border); padding:0.55rem 1.5rem 0.6rem;
}
.search-inner { max-width:480px; margin:0 auto; display:flex; flex-direction:column; gap:0.3rem; }
/* Scope caption — always tells the user this box searches only the current
   section, with a one-tap route to the site-wide overlay. */
.search-scope-row {
  display:flex; align-items:center; justify-content:center; gap:0.5rem;
  flex-wrap:wrap; direction:ltr; text-align:left;
}
.search-scope { font-size:max(12px,0.72rem); font-weight:600; color:var(--ink3); direction:ltr; }
.search-scope strong { color:var(--ink2); font-weight:700; }
.search-scope-all {
  font-size:max(12px,0.72rem); font-weight:600; color:var(--accent);
  background:rgba(94,61,232,0.09); border:1px solid rgba(94,61,232,0.18);
  border-radius:980px; padding:2px 9px; cursor:pointer; direction:ltr;
  transition:background 0.15s;
}
.search-scope-all:hover { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
html[data-dark] .search-scope-all { background:rgba(150,120,255,0.12); }
html[data-dark] .search-scope-all:hover { background:var(--accent); color:var(--on-accent); }
/* Offline notice — a quiet statement of fact, never a warning. It appears only
   when the reader is on the bundled offline copy inside the app, or the browser
   reports no connection, and it goes as soon as the live site is being served. */
.offline-pill {
  display:none; align-items:center; gap:5px;
  font-size:max(12px,0.72rem); font-weight:600; color:var(--ink2);
  background:var(--surface2); border:1px solid var(--border);
  border-radius:980px; padding:2px 9px; direction:ltr; white-space:nowrap;
}
.offline-pill.show { display:inline-flex; }
.offline-pill svg { width:12px; height:12px; flex:0 0 auto; color:var(--ink3); }
html[data-dark] .offline-pill { background:rgba(255,255,255,0.06); }
.search-input-wrap { position:relative; display:flex; align-items:center; }
.search-icon { position:absolute; right:0.85rem; color:var(--ink3); pointer-events:none; }
.search-clear { position:absolute; left:0.65rem; background:none; border:none; color:var(--ink3); cursor:pointer; font-size:0.75rem; padding:0.1rem 0.3rem; border-radius:50%; line-height:1; transition:color 0.15s, background 0.15s; }
.search-clear:hover { color:var(--ink); background:var(--surface3); }
.search-inner input {
  width:100%; padding:0.44rem 2.3rem 0.44rem 2rem; font-family:inherit; font-size:0.92rem;
  border:1.5px solid transparent; border-radius:980px; background:var(--surface);
  color:var(--ink); outline:none; transition:all 0.2s; direction:ltr; text-align:left;
  box-shadow:var(--shadow-sm);
}
.search-inner input[dir="rtl"] { text-align:right; }
.search-inner input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(94,61,232,0.12); }
.search-inner input::placeholder { color:var(--ink3); }
/* Mobile-only control variants — hidden on desktop (which keeps text + toolbar count). */
.field-count { display:none; }
.filters-icon { display:none; }
.ec-ic { display:none; }
/* Keep the field at 16px on mobile so iOS doesn't zoom on focus, while the
   pill stays visually compact via width + padding. */
@media (max-width:600px){ .search-inner input { font-size:16px; padding-top:0.48rem; padding-bottom:0.48rem; } }
/* On narrower desktop / portrait-tablet widths a full-width centred search box
   would slide under the floating top-right icons (favourites · info · search ·
   dark mode), which sit up to ~186px in from the right edge. Instead of shoving
   the whole cluster left (which looked off-centre on iPads), keep it centred
   and just cap its width so a centred box still clears the icons: it needs
   width ≤ viewport − 372px, so we reserve 400px for a safe margin. From 900px up
   the full 480px box clears them on its own and this cap is inert. Icons are
   hidden ≤600px (mobile nav), so this only applies 601–899px. Net effect: the
   search bar, Inspire button, filters and toolbar stay truly centred on every
   size from small tablets up — just a touch narrower on portrait tablets. */
@media (min-width:601px) and (max-width:899px){
  .search-inner { max-width:min(480px, calc(100vw - 400px)); }
}
/* ── Desktop / tablet (≥601px): tidy the control area ──────────────────────
   Group the Filters toggle (label + arrow together, centred) instead of flinging
   them to opposite ends of a full-width row; centre the count / expand-collapse
   row; drop the cramped, truncated keyboard hint; and let the result count show
   in full. Mobile (≤600) keeps its own compact icon layout. */
@media (min-width:601px){
  .filters-toggle { align-self:center; width:auto; justify-content:center; gap:0.4rem; }
  #searchToolbar { justify-content:center !important; }
  .search-kb-hint { display:none; }
  #resultsCount { overflow:visible; width:auto; min-width:max-content; }
}

/* ── COLLAPSIBLE FILTERS PANEL ────────────────────────────────────────── */
.filters-toggle {
  display:flex; align-items:center; justify-content:space-between; gap:0.6rem;
  cursor:pointer; user-select:none; padding:0.25rem 0.7rem; border-radius:10px;
  transition:background 0.18s;
}
.filters-toggle:hover { background:rgba(94,61,232,0.06); }
.filters-toggle:hover .filters-toggle-arrow { background:rgba(94,61,232,0.15); }
.filters-toggle-label { font-size:0.8rem; font-weight:600; color:var(--ink2); direction:ltr; }
.filters-toggle-arrow {
  display:inline-flex; align-items:center; gap:5px; font-size:0.75rem; font-weight:600;
  color:var(--accent); background:rgba(94,61,232,0.09); border:1px solid rgba(94,61,232,0.18);
  border-radius:980px; padding:3px 10px; flex-shrink:0; white-space:nowrap; transition:background 0.18s;
}
.filters-body { display:flex; flex-direction:column; gap:0.5rem; align-items:center; }
.filters-body > div { width:100%; }
/* Center every filter row inside the collapsible panel.
   "safe center" keeps centering when the row fits, but falls back to start
   alignment when the row overflows — so horizontally-scrollable strips are
   not pushed out symmetrically (which would clip the first chips). */
.filters-body .lh-view-row,
.filters-body .lh-sec-row,
.filters-body .filters,
.filters-body #shrTopicRow,
.filters-body #schTopicRow,
.filters-body #alAuthorRow,
.filters-body #alYearRow,
.filters-body #alTopicRow { justify-content:safe center; }
/* Pill style for the added section filters (not bound to global handlers) */
.fbtn {
  font-family:inherit; font-size:0.78rem; font-weight:500; padding:0.3rem 0.85rem;
  border:1.5px solid var(--border); border-radius:980px;
  background:var(--surface); color:var(--ink2); cursor:pointer; transition:all 0.15s; white-space:nowrap;
  box-shadow:var(--shadow-sm);
}
.fbtn:hover { border-color:var(--accent); color:var(--accent); }
.fbtn.active { background:var(--accent); color:var(--on-accent); border-color:var(--accent); box-shadow:0 2px 8px rgba(94,61,232,0.25); }

/* ── FILTER BUTTONS ───────────────────────────────────────────────────── */
.filters { display:flex; flex-wrap:wrap; gap:0.4rem; direction:rtl; }
.section-filters { display:flex; flex-direction:column; gap:0; direction:rtl; }
.filter-btn {
  font-family:inherit; font-size:0.78rem; font-weight:500; padding:0.3rem 0.85rem;
  border:1.5px solid var(--border); border-radius:980px;
  background:var(--surface); color:var(--ink2); cursor:pointer; transition:all 0.15s; white-space:nowrap;
  box-shadow:var(--shadow-sm);
}
.filter-btn:hover { border-color:var(--accent); color:var(--accent); }
.filter-btn.active { background:var(--accent); color:var(--on-accent); border-color:var(--accent); box-shadow:0 2px 8px rgba(94,61,232,0.25); }
.sec-btn {
  font-family:inherit; font-size:0.78rem; font-weight:500; padding:0.3rem 0.85rem;
  border:1.5px solid var(--border); border-radius:980px;
  background:var(--surface); color:var(--ink2); cursor:pointer; transition:all 0.15s; white-space:nowrap;
  box-shadow:var(--shadow-sm);
}
.sec-btn:hover { border-color:var(--accent); color:var(--accent); }
.sec-btn.active { color:#fff; box-shadow:0 2px 8px rgba(0,0,0,0.2); }
.sec-chelek { display:inline-flex; align-items:center; justify-content:center; width:1.3rem; height:1.3rem; border-radius:50%; font-size:max(12px,0.68rem); font-weight:700; color:#fff; margin-right:0.15rem; }
.sec-btn-oc { border-color:rgba(0,113,227,0.2); color:var(--oc); }
.sec-btn-oc:hover,.sec-btn-oc.active { background:var(--oc); border-color:var(--oc); color:var(--on-accent); }
.sec-btn-yd { border-color:rgba(28,138,46,0.2); color:var(--yd); }
.sec-btn-yd:hover,.sec-btn-yd.active { background:var(--yd); border-color:var(--yd); color:var(--on-accent); }
.sec-btn-cm { border-color:rgba(122,59,196,0.2); color:var(--cm); }
.sec-btn-cm:hover,.sec-btn-cm.active { background:var(--cm); border-color:var(--cm); color:var(--on-accent); }
.sec-btn-ae { border-color:rgba(191,72,0,0.2); color:var(--ae); }
.sec-btn-ae:hover,.sec-btn-ae.active { background:var(--ae); border-color:var(--ae); color:var(--on-accent); }
.sec-btn-hk { color:var(--hk); border-color:rgba(110,110,115,0.2); }
.sec-btn-hk:hover,.sec-btn-hk.active { background:var(--hk); border-color:var(--hk); color:#fff; }
.sec-btn-src { color:var(--accent); border-color:rgba(94,61,232,0.2); }
.sec-btn-src:hover, .sec-btn-src.active { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.sec-btn-all { color:var(--ink2); border-color:var(--border); }
.sec-btn-all:hover { border-color:var(--accent); color:var(--accent); }
.sec-btn-all.active { background:var(--ink); color:#fff; border-color:var(--ink); box-shadow:0 2px 8px rgba(0,0,0,0.2); }
.results-count { font-size:0.78rem; color:var(--ink3); direction:ltr; padding-right:0.25rem; }

/* ── MAIN CARDS ───────────────────────────────────────────────────────── */
main { max-width:780px; margin:0 auto; padding:1.8rem 1rem 4rem; }
.entry,.lh-entry {
  background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem;
  overflow:hidden; box-shadow:var(--shadow-sm);
  border:1px solid var(--border);
  transition:box-shadow 0.2s, transform 0.15s;
}
.entry:hover,.lh-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }

/* ── TOGGLE ARROW ─────────────────────────────────────────────────────── */
.card-toggle-arrow {
  margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center;
  justify-content:center; border-radius:50%; background:var(--accent-light);
  border:1.5px solid rgba(94,61,232,0.15); color:var(--accent); font-size:1rem; flex-shrink:0;
  transition:transform 0.2s, background 0.15s; cursor:pointer;
}
.entry.open .shr-body { display:block !important; }
.entry.open .card-toggle-arrow,
.lh-entry.open .card-toggle-arrow,
.parsha-entry.open .card-toggle-arrow,
.lt-entry.open .card-toggle-arrow,
.halacha-block.open .card-toggle-arrow { transform:rotate(180deg); background:var(--accent); color:var(--on-accent); border-color:var(--accent); }

/* ── ENTRY HEADERS ────────────────────────────────────────────────────── */
.entry-header,.lh-header {
  display:flex; align-items:center; gap:0.75rem;
  padding:0.9rem 1.2rem 0.75rem; border-bottom:1px solid var(--border);
  flex-wrap:nowrap; min-width:0; cursor:pointer; user-select:none;
}
.entry-header:hover,.lh-header:hover { background:var(--accent-light); }
.entry:not(.open) .entry-header, .lh-entry:not(.open) .lh-header { border-bottom:none; }

/* ── COLLAPSED BODIES ─────────────────────────────────────────────────── */
.entry:not(.open) .halachos-list,
.entry:not(.open) .topics-label, .entry:not(.open) .topics-row,
.entry:not(.open) .eitzos-label, .entry:not(.open) .eitzos-row,
.entry:not(.open) .le-eitza-block,
.entry:not(.open) .shr-body,
.entry:not(.open) .said-block, .entry:not(.open) .no-lh-note,
.entry:not(.open) .aos-label, .entry:not(.open) .aos-row,
.entry:not(.open) .soc-section-wrap,
.lh-entry:not(.open) .torah-list,
.parsha-entry:not(.open) .parsha-torah-list,
.lt-entry:not(.open) .lt-body, .lt-entry:not(.open) .topics-label, .lt-entry:not(.open) .topics-row,
.halacha-block:not(.open) .halacha-source-list { display:none; }
.entry-header, .lh-header, .parsha-header, .lt-header, .halacha-block-header { cursor:pointer; user-select:none; }
.parsha-entry:not(.open) .parsha-header, .lt-entry:not(.open) .lt-header, .halacha-block:not(.open) .halacha-block-header { border-bottom:none; }

/* ── ENTRY FIELDS ─────────────────────────────────────────────────────── */
.entry-num { font-size:1rem; font-weight:700; color:var(--accent); direction:ltr; white-space:nowrap; letter-spacing:0.02em; }
.entry-book {
  font-size:max(12px,0.7rem); font-weight:600; letter-spacing:0.04em; padding:0.2rem 0.7rem;
  border-radius:980px; background:var(--accent-light); color:var(--accent); white-space:nowrap; flex-shrink:0;
}
.entry-title,.lh-title { font-size:1rem; font-weight:600; color:var(--ink); flex:1; line-height:1.3; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.entry-title-en { display:none; }
.entry.open .entry-title-en { display:inline; font-size:0.78rem; font-weight:400; color:var(--ink2); direction:ltr; }

/* ── HALACHA / TORAH ITEMS ─────────────────────────────────────────────── */
.halachos-list,.torah-list { padding:0.3rem 0; }
.halacha-item,.torah-item {
  display:flex; align-items:center; gap:0.5rem; padding:0.55rem 1.2rem;
  border-bottom:1px solid var(--border); flex-wrap:wrap; transition:background 0.12s;
}
.halacha-item:last-child,.torah-item:last-child { border-bottom:none; }
.halacha-item:hover,.torah-item:hover { background:var(--accent-light); }
.section-pill {
  display:inline-flex; align-items:center; gap:0.3rem; border-radius:980px;
  padding:0.2rem 0.7rem; font-size:max(12px,0.7rem); font-weight:600; white-space:nowrap; flex-shrink:0;
}
.pill-oc { background:rgba(0,113,227,0.1); color:var(--oc); }
.pill-yd { background:rgba(28,138,46,0.1); color:var(--yd); }
.pill-cm { background:rgba(122,59,196,0.1); color:var(--cm); }
.pill-ae { background:rgba(191,72,0,0.1); color:var(--ae); }
.pill-hk { background:rgba(110,110,115,0.1); color:var(--hk); }
.chelek-badge {
  font-size:max(12px,0.62rem); font-weight:700; width:1.25rem; height:1.25rem; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; color:#fff;
}
.badge-oc { background:var(--oc); } .badge-yd { background:var(--yd); } .badge-cm { background:var(--cm); }
.halacha-text,.torah-title { font-size:0.9rem; color:var(--ink); line-height:1.4; flex:1; }
.torah-num { font-size:0.95rem; font-weight:700; color:var(--accent); direction:ltr; white-space:nowrap; }
.torah-book { font-size:max(12px,0.68rem); font-weight:600; padding:0.15rem 0.55rem; border-radius:980px; background:var(--accent-light); color:var(--accent); white-space:nowrap; }

/* ── SECTION HEADINGS ─────────────────────────────────────────────────── */
.lh-section-heading { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.06em; color:var(--accent); padding:1.2rem 0 0.4rem; text-transform:uppercase; }
.no-results { text-align:center; padding:4rem 1rem; color:var(--ink3); font-size:1rem; }

/* ── TEFILA ─────────────────────────────────────────────────────────────── */
.lt-entry { background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem; overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border); transition:box-shadow 0.2s, transform 0.15s; }
.lt-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.lt-header { display:flex; align-items:center; gap:0.75rem; padding:0.9rem 1.2rem 0.6rem; border-bottom:1px solid var(--border); flex-wrap:nowrap; min-width:0; }
.lt-header:hover { background:var(--accent-light); }
.lt-num { font-size:1.1rem; font-weight:700; color:var(--accent); direction:ltr; white-space:nowrap; }
.lt-label { font-size:max(12px,0.7rem); font-weight:600; letter-spacing:0.04em; padding:0.2rem 0.7rem; border-radius:980px; background:var(--accent-light); color:var(--accent); white-space:nowrap; flex:1; }
.lt-body { display:flex; flex-direction:column; gap:0.4rem; padding:0.65rem 1.2rem 0.8rem; }
.lt-torah-row { display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; padding:0.25rem 0; border-bottom:1px solid var(--border); }
.lt-torah-row:last-child { border-bottom:none; }
.lt-torah-title { font-size:0.95rem; font-weight:600; color:var(--ink); flex:1; line-height:1.3; }
.torah-combined { display:inline-flex; align-items:center; font-size:0.75rem; font-weight:700; padding:0.22rem 0.7rem; border-radius:980px; background:var(--accent); color:var(--on-accent); white-space:nowrap; flex-shrink:0; direction:ltr; }
.tefila-badge { display:inline-flex; align-items:center; gap:0.25rem; font-size:max(12px,0.68rem); font-weight:600; padding:0.18rem 0.6rem; border-radius:980px; background:var(--accent-light); color:var(--accent); white-space:nowrap; flex-shrink:0; }

/* ── PARSHA ─────────────────────────────────────────────────────────────── */
.parsha-entry { background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem; overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border); transition:box-shadow 0.2s, transform 0.15s; }
.parsha-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.parsha-header { display:flex; align-items:center; gap:0.75rem; padding:0.9rem 1.2rem 0.75rem; border-bottom:1px solid var(--border); flex-wrap:nowrap; min-width:0; }
.parsha-header:hover { background:var(--accent-light); }
.parsha-he { font-size:1.1rem; font-weight:700; color:var(--ink); white-space:nowrap; }
.parsha-en { font-size:0.82rem; font-weight:500; color:var(--ink2); direction:ltr; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.parsha-torah-list { padding:0.3rem 0; }
.parsha-torah-item { display:flex; align-items:center; gap:0.6rem; padding:0.55rem 1.2rem; border-bottom:1px solid var(--border); flex-wrap:wrap; transition:background 0.12s; }
.parsha-torah-item:last-child { border-bottom:none; }
.parsha-torah-item:hover { background:var(--accent-light); }
.ps-lh-refs { font-size:max(12px,0.72rem); color:var(--ink2); direction:rtl; white-space:normal; }
.ps-lh-item .halacha-text { flex:0 1 auto; }

/* ── EITZOS ─────────────────────────────────────────────────────────────── */
.eitzos-row { background:rgba(28,138,46,0.04) !important; }
.eitzos-row .topic-tl { color:#005a1c !important; }
.eitzos-label { color:var(--yd) !important; }

/* ── LE eitza summaries (per-paragraph) ─────────────────────────────────── */
.le-eitza-block { padding:0.15rem 0 0.35rem; }
.le-eitza-block-title { font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--accent); padding:0.6rem 1.2rem 0.25rem; }
.le-eitza-topic-head { font-size:0.78rem; font-weight:700; color:var(--ink); padding:0.55rem 1.2rem 0.2rem; direction:rtl; text-align:right; }
.le-eitza-item { display:flex; align-items:flex-start; gap:0.55rem; padding:0.4rem 1.2rem; border-bottom:1px solid var(--border); transition:background 0.12s; }
.le-eitza-item:last-child { border-bottom:none; }
.le-eitza-item:hover { background:var(--accent-light); }
.le-eitza-num { font-size:0.78rem; font-weight:700; color:var(--accent); flex-shrink:0; min-width:1.5rem; direction:rtl; }
.le-eitza-sub { font-size:max(12px,0.68rem); font-weight:600; color:var(--ink2); flex-shrink:0; direction:rtl; padding-top:0.05rem; }
.le-eitza-sum { font-size:0.88rem; color:var(--ink); line-height:1.5; flex:1; min-width:0; direction:ltr; text-align:left; }
.le-eitza-sef { flex-shrink:0; align-self:flex-start; margin-left:0.4rem; padding:0.12rem 0.45rem; font-size:0.85rem; line-height:1.3; text-decoration:none; }

/* ── TOPICS ─────────────────────────────────────────────────────────────── */
.topics-label { font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--accent); text-transform:uppercase; padding:0.7rem 1.2rem 0; }
.topics-row { display:flex; flex-wrap:wrap; gap:0.4rem; padding:0.5rem 1.2rem 0.75rem; }
.topic-chip { display:inline-flex; align-items:center; gap:0.3rem; background:var(--accent-light); border:1px solid rgba(94,61,232,0.15); border-radius:980px; padding:0.25rem 0.75rem; font-size:0.78rem; }
.topic-he { font-weight:600; color:var(--accent); }
.topic-tl { font-weight:400; color:var(--accent2); }
.topic-meaning { font-weight:300; color:var(--ink2); font-size:max(12px,0.72rem); }

/* ── LH BY-HALACHA ──────────────────────────────────────────────────────── */
.lh-view-row { display:flex; flex-direction:row; gap:0.4rem; align-items:center; padding-bottom:0.5rem; border-bottom:1px solid var(--border); width:100%; }
.lh-sec-row { display:flex; flex-wrap:wrap; gap:0.4rem; direction:rtl; width:100%; padding-top:0.3rem; }
.lh-view-btn { font-family:inherit; font-size:0.8rem; font-weight:600; padding:0.38rem 1rem; border:1.5px solid rgba(94,61,232,0.25); border-radius:980px; background:var(--surface); color:var(--ink2); cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.lh-view-btn.active { background:var(--accent); color:var(--on-accent); border-color:var(--accent); box-shadow:0 2px 8px rgba(94,61,232,0.3); }
.halacha-section { margin-bottom:2rem; }
.halacha-section-heading { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.06em; color:var(--accent); text-transform:uppercase; padding:1.2rem 0 0.6rem; display:flex; align-items:baseline; gap:0.5rem; flex-wrap:wrap; border-bottom:1px solid rgba(94,61,232,0.12); margin-bottom:0.5rem; }
.halacha-block { background:var(--surface); border-radius:var(--radius); margin-bottom:0.65rem; overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border); transition:box-shadow 0.2s, transform 0.15s; }
.halacha-block:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.halacha-block-header { padding:0.75rem 1.2rem 0.5rem; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:0.6rem; flex-wrap:nowrap; min-width:0; cursor:pointer; user-select:none; }
.halacha-block-header:hover { background:var(--accent-light); }
.halacha-block-name { font-size:1rem; font-weight:700; color:var(--ink); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.halacha-block-en { font-size:0.75rem; font-weight:400; color:var(--ink2); direction:ltr; }
.halacha-source-list { padding:0.2rem 0; }
.halacha-source-item { display:flex; align-items:center; gap:0.55rem; padding:0.45rem 1.2rem; border-bottom:1px solid var(--border); flex-wrap:wrap; transition:background 0.12s; }
.halacha-source-item:last-child { border-bottom:none; }
.halacha-source-item:hover { background:var(--accent-light); }
.halacha-source-badge { font-size:max(12px,0.72rem); font-weight:700; padding:0.18rem 0.65rem; border-radius:980px; white-space:nowrap; flex-shrink:0; direction:ltr; }
.badge-kama { background:var(--accent-light); color:var(--accent); }
.badge-tinyana { background:rgba(94,61,232,0.05); color:var(--accent2); }
.badge-sipurim { background:rgba(88,86,214,0.1); color:#5856d6; }
.badge-sichos { background:rgba(185,100,0,0.1); color:#b96400; }
.badge-midos { background:rgba(28,138,46,0.1); color:var(--yd); }
.halacha-source-title { font-size:0.88rem; color:var(--ink); line-height:1.4; flex:1; text-align:start; unicode-bidi:plaintext; }
/* Auto-direction for cross-reference titles: English titles align left (LTR), Hebrew titles stay right (RTL) — same class, per-content. */
.lt-torah-title, .halacha-block-name { text-align:start; unicode-bidi:plaintext; }

/* ── DAILY BANNER ───────────────────────────────────────────────────────── */
.daily-banner {
  background: linear-gradient(135deg, #f8f7ff 0%, #ede9ff 50%, #e8f0ff 100%);
  border-top:1px solid rgba(94,61,232,0.1);
  border-bottom:1px solid rgba(94,61,232,0.1);
  padding:0.65rem 1.4rem;
  display:flex; flex-direction:column; gap:0;
}
.daily-banner-header:hover { background:rgba(94,61,232,0.06); }
.daily-banner-header:hover #dailyBannerArrow { background:rgba(94,61,232,0.15); }
.daily-date-row { display:flex; align-items:center; justify-content:center; gap:0.6rem; flex-wrap:wrap; font-size:0.82rem; color:var(--ink2); font-weight:500; text-align:center; }
.daily-date-en { direction:ltr; }
.daily-date-sep { opacity:0.3; }
.daily-date-he { font-size:0.88rem; font-weight:700; color:var(--accent); direction:rtl; }
.daily-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; align-items:start; max-width:720px; margin:0 auto; width:100%; }
@media (max-width:560px) { .daily-grid { grid-template-columns:1fr; } }
.daily-card {
  background:rgba(255,255,255,0.85);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(94,61,232,0.12);
  border-radius:14px; padding:0.9rem 1.1rem;
  display:flex; flex-direction:column; gap:0.2rem;
  box-shadow:0 2px 12px rgba(94,61,232,0.07), 0 1px 3px rgba(0,0,0,0.05);
}
.daily-card-label { font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--accent); direction:ltr; }
.daily-card-main { font-size:1.05rem; font-weight:700; color:var(--ink); direction:rtl; line-height:1.3; margin-top:0.1rem; }
.daily-card-sub { font-size:0.75rem; color:var(--ink2); direction:rtl; }
.daily-card-sub-en { font-size:max(12px,0.72rem); color:var(--ink3); direction:ltr; }
.daily-card-soon { font-size:0.8rem; color:var(--ink2); font-style:italic; direction:ltr; }
.daily-explore-btn { margin-top:0.6rem; font-family:inherit; font-size:max(12px,0.72rem); font-weight:600; padding:0.32rem 0.85rem; border:1.5px solid rgba(94,61,232,0.3); border-radius:980px; background:transparent; color:var(--accent); cursor:pointer; direction:ltr; transition:all 0.15s; align-self:flex-start; }
.daily-explore-btn:hover { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.daily-assoc-wrap { margin-top:0.5rem; border-top:1px solid rgba(94,61,232,0.1); padding-top:0.4rem; display:flex; flex-direction:column; gap:0.3rem; }
.daily-assoc-group { display:flex; flex-direction:column; gap:0.2rem; }
.daily-assoc-label { font-size:max(12px,0.62rem); font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--accent); direction:rtl; padding-top:0.15rem; }
.daily-assoc-item { direction:rtl; }
.daily-assoc-pill { display:inline-block; font-size:max(12px,0.72rem); padding:0.15rem 0.5rem; border-radius:6px; line-height:1.4; }
.daily-assoc-lh { background:rgba(94,61,232,0.08); color:var(--accent); }
.daily-assoc-lt { background:rgba(185,100,0,0.1); color:#b96400; }
.daily-assoc-le { background:rgba(28,138,46,0.08); color:#005a1c; }
.daily-assoc-ps { background:rgba(94,61,232,0.08); color:var(--accent2); }

/* ── MOBILE ─────────────────────────────────────────────────────────────── */

.sec-btn { font-family:inherit; font-size:0.75rem; font-weight:600; padding:0.28rem 0.8rem; border:1.5px solid transparent; border-radius:980px; background:var(--surface2); cursor:pointer; transition:all 0.15s; white-space:nowrap; display:inline-flex; align-items:center; gap:0.3rem; }
.sec-btn .sec-chelek { font-size:max(12px,0.65rem); font-weight:700; width:1.2rem; height:1.2rem; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; color:#fff; }
/* These soft-tint chips MUST each restate `color`. The generic
   `.sec-btn.active { color:#fff }` higher up has equal specificity and would
   otherwise leak white text onto a 10%-opacity tint — i.e. an invisible label
   (~1.3:1). Never drop the `color` from an :hover/.active rule here.
   Dark-mode counterparts live in the SELECTED FILTER/TOGGLE LEGIBILITY block. */
.sec-btn-oc { color:var(--oc); border-color:rgba(0,119,237,0.2); }
.sec-btn-oc:hover,.sec-btn-oc.active { background:rgba(0,119,237,0.12); border-color:var(--oc); color:#004f9e; }
.sec-btn-yd { color:var(--yd); border-color:rgba(0,134,42,0.2); }
.sec-btn-yd:hover,.sec-btn-yd.active { background:rgba(0,134,42,0.12); border-color:var(--yd); color:#0e5c18; }
.sec-btn-cm { color:var(--cm); border-color:rgba(137,68,171,0.2); }
.sec-btn-cm:hover,.sec-btn-cm.active { background:rgba(137,68,171,0.12); border-color:var(--cm); color:#63309f; }
.sec-btn-ae { color:var(--ae); border-color:rgba(191,72,0,0.2); }
.sec-btn-ae:hover,.sec-btn-ae.active { background:rgba(191,72,0,0.12); border-color:var(--ae); color:#8f3600; }
.sec-btn-hk { color:var(--hk); border-color:rgba(110,110,115,0.2); }
.sec-btn-hk:hover,.sec-btn-hk.active { background:rgba(110,110,115,0.12); border-color:var(--hk); color:#55555a; }
.sec-btn-src { color:#5856d6; border-color:rgba(88,86,214,0.2); }
.sec-btn-src:hover, .sec-btn-src.active { background:rgba(88,86,214,0.12); border-color:#5856d6; color:#403eab; }
/* Anatomy of the Soul chips. These previously carried inline
   `style="color:var(--aos)"`, which beat `.sec-btn.active{color:#fff}` and left
   the selected chip pixel-identical to the unselected ones. */
.sec-btn-aos { color:var(--aos); border-color:var(--aos-mid); }
.sec-btn-aos:hover { background:var(--aos-light); border-color:var(--aos); color:var(--aos); }
.sec-btn-aos.active { background:var(--aos); border-color:var(--aos); color:var(--on-accent); }
.sec-btn-all { color:var(--ink2); border-color:var(--border); }
.sec-btn-all:hover { border-color:var(--ink3); color:var(--ink); }
.sec-btn-all.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.results-count { font-size:0.78rem; color:var(--ink3); direction:ltr; padding-right:0.25rem; }
main { max-width:780px; margin:0 auto; padding:1.5rem 1rem 4rem; }
.entry,.lh-entry { background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04); transition:box-shadow 0.2s; }
.entry:hover,.lh-entry:hover { box-shadow:0 4px 16px rgba(0,0,0,0.1); }
.entry-header,.lh-header { display:flex; align-items:center; gap:0.75rem; padding:0.9rem 1.2rem 0.75rem; border-bottom:1px solid var(--border); flex-wrap:nowrap; min-width:0; }
.entry-num { font-size:1rem; font-weight:700; color:var(--ink); direction:ltr; white-space:nowrap; letter-spacing:0.02em; }
.entry-book { font-size:max(12px,0.7rem); font-weight:600; letter-spacing:0.04em; padding:0.2rem 0.6rem; border-radius:980px; background:var(--surface2); color:var(--ink2); white-space:nowrap; flex-shrink:0; }
.entry-title,.lh-title { font-size:1rem; font-weight:600; color:var(--ink); flex:1; line-height:1.3; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.entry-title-en { display:none; }
.halachos-list,.torah-list { padding:0.3rem 0; }
.halacha-item,.torah-item { display:flex; align-items:center; gap:0.5rem; padding:0.5rem 1.2rem; border-bottom:1px solid var(--border); flex-wrap:wrap; transition:background 0.12s; }
.halacha-item:last-child,.torah-item:last-child { border-bottom:none; }
.halacha-item:hover,.torah-item:hover { background:var(--surface2); }
.section-pill { display:inline-flex; align-items:center; gap:0.3rem; border-radius:980px; padding:0.18rem 0.65rem; font-size:max(12px,0.7rem); font-weight:600; white-space:nowrap; flex-shrink:0; }
.pill-oc { background:rgba(0,119,237,0.1); color:var(--oc); }
.pill-yd { background:rgba(0,134,42,0.1); color:var(--yd); }
.pill-cm { background:rgba(137,68,171,0.1); color:var(--cm); }
.pill-ae { background:rgba(191,72,0,0.1); color:var(--ae); }
.pill-hk { background:rgba(110,110,115,0.1); color:var(--hk); }
.chelek-badge { font-size:max(12px,0.62rem); font-weight:700; width:1.25rem; height:1.25rem; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; color:#fff; }
.badge-oc { background:var(--oc); } .badge-yd { background:var(--yd); } .badge-cm { background:var(--cm); }
.halacha-text,.torah-title { font-size:0.9rem; color:var(--ink); line-height:1.4; flex:1; }
.torah-num { font-size:0.95rem; font-weight:700; color:var(--ink); direction:ltr; white-space:nowrap; }
.torah-book { font-size:max(12px,0.68rem); font-weight:600; padding:0.15rem 0.5rem; border-radius:980px; background:var(--surface2); color:var(--ink2); white-space:nowrap; }
.lh-section-heading { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.06em; color:var(--ink3); padding:1.2rem 0 0.4rem; }
.no-results { text-align:center; padding:4rem 1rem; color:var(--ink3); font-size:1rem; }

/* ── Collapsible cards ── */
.card-toggle-arrow { margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--surface2); border:1.5px solid var(--border); color:var(--ink2); font-size:1rem; flex-shrink:0; transition:transform 0.2s, background 0.15s; cursor:pointer; }
.entry.open .shr-body { display:block !important; }
.entry.open .card-toggle-arrow,
.lh-entry.open .card-toggle-arrow,
.parsha-entry.open .card-toggle-arrow,
.lt-entry.open .card-toggle-arrow,
.halacha-block.open .card-toggle-arrow { transform:rotate(180deg); background:var(--ink); color:#fff; border-color:var(--ink); }
/* Collapsed: hide body */
.entry:not(.open) .halachos-list,
.entry:not(.open) .topics-label,
.entry:not(.open) .topics-row,
.entry:not(.open) .eitzos-label,
.entry:not(.open) .eitzos-row,
.entry:not(.open) .le-eitza-block,
.entry:not(.open) .aos-label,
.entry:not(.open) .aos-row,
.entry:not(.open) .soc-section-wrap,
.lh-entry:not(.open) .torah-list,
.parsha-entry:not(.open) .parsha-torah-list,
.lt-entry:not(.open) .lt-body,
.lt-entry:not(.open) .topics-label,
.lt-entry:not(.open) .topics-row,
.halacha-block:not(.open) .halacha-source-list { display:none; }
/* Headers become clickable */
.entry-header, .lh-header, .parsha-header, .lt-header, .halacha-block-header { cursor:pointer; user-select:none; }
.entry-header:hover, .lh-header:hover, .parsha-header:hover, .lt-header:hover, .halacha-block-header:hover { background:var(--surface2); }
.entry:not(.open) .entry-header,
.lh-entry:not(.open) .lh-header,
.parsha-entry:not(.open) .parsha-header,
.lt-entry:not(.open) .lt-header,
.halacha-block:not(.open) .halacha-block-header { border-bottom:none; }
.lt-entry { background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.06); transition:box-shadow 0.2s; }
.lt-entry:hover { box-shadow:0 4px 16px rgba(0,0,0,0.1); }
.lt-header { display:flex; align-items:center; gap:0.75rem; padding:0.9rem 1.2rem 0.6rem; border-bottom:1px solid var(--border); flex-wrap:nowrap; min-width:0; }
.lt-num { font-size:1.1rem; font-weight:700; color:#b96400; direction:ltr; white-space:nowrap; }
.lt-label { font-size:max(12px,0.7rem); font-weight:600; letter-spacing:0.04em; padding:0.18rem 0.6rem; border-radius:980px; background:rgba(185,100,0,0.1); color:#b96400; white-space:nowrap; flex:1; }
.lt-body { display:flex; flex-direction:column; gap:0.4rem; padding:0.65rem 1.2rem 0.8rem; }

.lt-torah-row { display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; padding:0.25rem 0; border-bottom:1px solid var(--border); }
.lt-torah-row:last-child { border-bottom:none; }
.lt-torah-title { font-size:0.95rem; font-weight:600; color:var(--ink); flex:1; line-height:1.3; }
.torah-combined { display:inline-flex; align-items:center; font-size:0.78rem; font-weight:700; padding:0.22rem 0.7rem; border-radius:980px; background:var(--ink); color:#fff; white-space:nowrap; flex-shrink:0; direction:ltr; }
.entry-title-en { display:none; }
.entry.open .entry-title-en { display:inline; font-size:0.78rem; font-weight:400; color:var(--ink2); direction:ltr; }
.tefila-badge { display:inline-flex; align-items:center; gap:0.25rem; font-size:max(12px,0.68rem); font-weight:600; padding:0.15rem 0.55rem; border-radius:980px; background:rgba(185,100,0,0.1); color:#b96400; white-space:nowrap; flex-shrink:0; }
.parsha-entry { background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.06); transition:box-shadow 0.2s; }
.parsha-entry:hover { box-shadow:0 4px 16px rgba(0,0,0,0.1); }
.parsha-header { display:flex; align-items:center; gap:0.75rem; padding:0.9rem 1.2rem 0.75rem; border-bottom:1px solid var(--border); flex-wrap:nowrap; min-width:0; }
.parsha-he { font-size:1.1rem; font-weight:700; color:var(--ink); white-space:nowrap; }
.parsha-en { font-size:0.82rem; font-weight:500; color:var(--ink2); direction:ltr; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.parsha-torah-list { padding:0.3rem 0; }
.parsha-torah-item { display:flex; align-items:center; gap:0.6rem; padding:0.5rem 1.2rem; border-bottom:1px solid var(--border); flex-wrap:wrap; transition:background 0.12s; }
.parsha-torah-item:last-child { border-bottom:none; }
.parsha-torah-item:hover { background:var(--surface2); }
.ps-lh-refs { font-size:max(12px,0.72rem); color:var(--ink2); direction:rtl; white-space:normal; }
.ps-lh-item .halacha-text { flex:0 1 auto; }
.eitzos-row { background:rgba(0,134,42,0.04) !important; }
.eitzos-row .topic-tl { color:#005a1c !important; }
.eitzos-label { color:#005a1c !important; }
.topics-row { display:flex; flex-direction:column; gap:0.25rem; padding:0.6rem 1.2rem 0.75rem; border-top:1px solid var(--border); background:rgba(185,100,0,0.03); }
.topic-chip { font-size:0.85rem; line-height:1.45; padding:0.05rem 0; }
.topic-chip .topic-he { font-weight:700; color:var(--ink); }
.topic-chip .topic-tl { font-weight:700; color:#7a4400; }
.topic-chip .topic-meaning { font-size:0.82rem; font-weight:400; color:var(--ink2); }
.topics-label { font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--ink3); text-transform:uppercase; padding:0.7rem 1.2rem 0; }
mark { background:rgba(255,213,79,0.4); color:inherit; border-radius:3px; padding:0 2px; }
/* ── Search match hint (shown on collapsed cards while searching) ──────── */
.match-hint{ display:flex; flex-wrap:wrap; align-items:center; gap:0.45rem; padding:0.5rem 1.2rem 0.6rem; font-size:0.8rem; line-height:1.45; color:var(--ink2); background:var(--accent-light); border-top:1px solid var(--border); cursor:pointer; }
.match-hint:hover{ background:var(--accent-mid); }
.match-where{ flex-shrink:0; font-size:max(12px,0.58rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--accent); background:var(--surface); border:1px solid var(--border); border-radius:980px; padding:0.14rem 0.55rem; }
.match-snip{ flex:1; min-width:0; color:var(--ink); }
.entry.open .match-hint, .lh-entry.open .match-hint, .lt-entry.open .match-hint, .parsha-entry.open .match-hint, .halacha-block.open .match-hint{ display:none; }
.no-lh-note { font-size:0.82rem; color:var(--ink3); font-style:italic; padding:0.5rem 1.2rem 0.65rem; direction:ltr; }
.search-kb-hint { font-size:max(12px,0.68rem); color:var(--ink3); direction:ltr; letter-spacing:0.01em; padding-bottom:0.15rem; }
kbd { display:inline-block; font-family:inherit; font-size:max(12px,0.65rem); font-weight:700; background:var(--surface3); border:1px solid var(--border); border-radius:4px; padding:0.05rem 0.35rem; color:var(--ink2); line-height:1.5; }
@media (hover:none) and (pointer:coarse) { .search-kb-hint { display:none; } }
.kb-focus { outline:2px solid var(--accent); outline-offset:1px; }
.said-label { color:#7a3bc4 !important; }
.said-block { background:rgba(122,59,196,0.05); border:1px solid rgba(122,59,196,0.15); border-radius:10px; padding:0.7rem 0.95rem; margin:0.15rem 1.2rem 0.65rem; }
.said-block .said-he { font-family:var(--font-ui); font-size:1.04rem; line-height:1.85; color:var(--ink); font-weight:500; }
.said-block .said-en { font-size:0.86rem; line-height:1.6; color:var(--ink2); margin-top:0.5rem; direction:ltr; }
.said-block .said-src { font-size:max(12px,0.7rem); color:var(--ink3); margin-top:0.5rem; direction:rtl; text-align:left; font-style:italic; }
.said-block mark { background:rgba(255,213,79,0.45); }
.sefer-en { font-size:max(12px,0.65rem); opacity:0.7; font-weight:400; }
.sec-btn-sefer-br { color:#b06000; border-color:rgba(176,96,0,0.2); }
.sec-btn-sefer-br:hover, .sec-btn-sefer-br.active { background:#b06000; border-color:#b06000; color:#fff; }
.sec-btn-sefer-sh { color:#0071e3; border-color:rgba(0,113,227,0.2); }
.sec-btn-sefer-sh:hover, .sec-btn-sefer-sh.active { background:#0071e3; border-color:#0071e3; color:#fff; }
.sec-btn-sefer-vk { color:#1c8a2e; border-color:rgba(28,138,46,0.2); }
.sec-btn-sefer-vk:hover, .sec-btn-sefer-vk.active { background:#1c8a2e; border-color:#1c8a2e; color:#fff; }
.sec-btn-sefer-bm { color:#7a3bc4; border-color:rgba(122,59,196,0.2); }
.sec-btn-sefer-bm:hover, .sec-btn-sefer-bm.active { background:#7a3bc4; border-color:#7a3bc4; color:#fff; }
.sec-btn-sefer-dv { color:#bf4800; border-color:rgba(191,72,0,0.2); }
.sec-btn-sefer-dv:hover, .sec-btn-sefer-dv.active { background:#bf4800; border-color:#bf4800; color:#fff; }
/* Chayei Moharan section filter buttons */
.sec-btn-cm-seder { color:#5e3de8; border-color:rgba(94,61,232,0.2); }
.sec-btn-cm-seder:hover,.sec-btn-cm-seder.active { background:rgba(94,61,232,0.1); border-color:#5e3de8; color:#5e3de8; }
.sec-btn-cm-seder.active { background:#5e3de8; color:#fff; }
.sec-btn-cm-shiv { color:#b45309; border-color:rgba(180,83,9,0.2); }
.sec-btn-cm-shiv:hover,.sec-btn-cm-shiv.active { background:rgba(180,83,9,0.1); border-color:#b45309; color:#b45309; }
.sec-btn-cm-shiv.active { background:#b45309; color:#fff; }
.sec-btn-cm-maalos { color:#1c8a2e; border-color:rgba(28,138,46,0.2); }
.sec-btn-cm-maalos:hover,.sec-btn-cm-maalos.active { background:rgba(28,138,46,0.1); border-color:#1c8a2e; color:#1c8a2e; }
.sec-btn-cm-maalos.active { background:#1c8a2e; color:#fff; }
.sec-btn-cm-avod { color:#0071e3; border-color:rgba(0,113,227,0.2); }
.sec-btn-cm-avod:hover,.sec-btn-cm-avod.active { background:rgba(0,113,227,0.1); border-color:#0071e3; color:#0071e3; }
.sec-btn-cm-avod.active { background:#0071e3; color:#fff; }
.sec-btn-cm-mitkar { color:#7a3bc4; border-color:rgba(122,59,196,0.2); }
.sec-btn-cm-mitkar:hover,.sec-btn-cm-mitkar.active { background:rgba(122,59,196,0.1); border-color:#7a3bc4; color:#7a3bc4; }
.sec-btn-cm-mitkar.active { background:#7a3bc4; color:#fff; }
.sec-btn-cm-uman { color:#bf4800; border-color:rgba(191,72,0,0.2); }
.sec-btn-cm-uman:hover,.sec-btn-cm-uman.active { background:rgba(191,72,0,0.1); border-color:#bf4800; color:#bf4800; }
.sec-btn-cm-uman.active { background:#bf4800; color:#fff; }
.sec-btn-cm-sippur { color:#b06000; border-color:rgba(176,96,0,0.2); }
.sec-btn-cm-sippur:hover,.sec-btn-cm-sippur.active { background:rgba(176,96,0,0.1); border-color:#b06000; color:#b06000; }
.sec-btn-cm-sippur.active { background:#b06000; color:#fff; }
.sec-btn-cm-rh { color:#c0392b; border-color:rgba(192,57,43,0.2); }
.sec-btn-cm-rh:hover,.sec-btn-cm-rh.active { background:rgba(192,57,43,0.1); border-color:#c0392b; color:#c0392b; }
.sec-btn-cm-rh.active { background:#c0392b; color:#fff; }
.sec-btn-cm-hash { color:#708090; border-color:rgba(112,128,144,0.25); }
.sec-btn-cm-hash:hover,.sec-btn-cm-hash.active { background:rgba(112,128,144,0.1); border-color:#708090; color:#708090; }
.sec-btn-cm-hash.active { background:#708090; color:#fff; }
.sec-btn-cm-emuna,.sec-btn-cm-hitb { color:#0c7c59; border-color:rgba(12,124,89,0.2); }
.sec-btn-cm-emuna:hover,.sec-btn-cm-emuna.active,.sec-btn-cm-hitb:hover,.sec-btn-cm-hitb.active { background:rgba(12,124,89,0.1); border-color:#0c7c59; color:#0c7c59; }
.sec-btn-cm-emuna.active,.sec-btn-cm-hitb.active { background:#0c7c59; color:#fff; }
.sec-btn-cm-mach { color:#6c6c70; border-color:rgba(108,108,112,0.2); }
.sec-btn-cm-mach:hover,.sec-btn-cm-mach.active { background:rgba(108,108,112,0.1); border-color:#6c6c70; color:#6c6c70; }
.sec-btn-cm-mach.active { background:#6c6c70; color:#fff; }
.sec-btn-cm-tzach { color:#8e44ad; border-color:rgba(142,68,173,0.2); }
.sec-btn-cm-tzach:hover,.sec-btn-cm-tzach.active { background:rgba(142,68,173,0.1); border-color:#8e44ad; color:#8e44ad; }
.sec-btn-cm-tzach.active { background:#8e44ad; color:#fff; }
.sec-btn-cm-bio,.sec-btn-cm-nesiah,.sec-btn-cm-nav,.sec-btn-cm-lem,.sec-btn-cm-nes { color:#2980b9; border-color:rgba(41,128,185,0.2); }
.sec-btn-cm-bio:hover,.sec-btn-cm-bio.active,.sec-btn-cm-nesiah:hover,.sec-btn-cm-nesiah.active,.sec-btn-cm-nav:hover,.sec-btn-cm-nav.active,.sec-btn-cm-lem:hover,.sec-btn-cm-lem.active,.sec-btn-cm-nes:hover,.sec-btn-cm-nes.active { background:rgba(41,128,185,0.1); border-color:#2980b9; color:#2980b9; }
.sec-btn-cm-bio.active,.sec-btn-cm-nesiah.active,.sec-btn-cm-nav.active,.sec-btn-cm-lem.active,.sec-btn-cm-nes.active { background:#2980b9; color:#fff; }
/* Clickable cross-reference links */
.ref-link { cursor:pointer; transition:opacity 0.15s; }
.ref-link:hover { opacity:0.72; text-decoration:none; }
@keyframes refFlash { 0%{box-shadow:0 0 0 0 rgba(94,61,232,0.6)}40%{box-shadow:0 0 0 5px rgba(94,61,232,0.25)}100%{box-shadow:0 0 0 0 rgba(94,61,232,0)} }
.ref-flash { animation:refFlash 1.1s ease; }
#scrollTopBtn {
  position:fixed; bottom:1.5rem; right:1.5rem; z-index:300;
  width:2.6rem; height:2.6rem; border-radius:50%;
  background:var(--accent); color:var(--on-accent); border:none; cursor:pointer;
  font-size:1.1rem; font-weight:700; line-height:1;
  box-shadow:0 4px 16px rgba(94,61,232,0.35);
  opacity:0; pointer-events:none;
  transition:opacity 0.2s, transform 0.2s;
  display:flex; align-items:center; justify-content:center;
}
#scrollTopBtn.visible { opacity:1; pointer-events:auto; }
#scrollTopBtn:hover { transform:translateY(-2px); background:var(--accent2); }
.lh-view-row { display:flex; flex-direction:row; gap:0.4rem; align-items:center; padding-bottom:0.5rem; border-bottom:1px solid var(--border); width:100%; flex-wrap:wrap; }
.lh-sec-row { display:flex; flex-wrap:wrap; gap:0.4rem; direction:rtl; width:100%; padding-top:0.3rem; }
.lh-view-btn { font-family:inherit; font-size:0.8rem; font-weight:600; padding:0.35rem 1rem; border:1.5px solid var(--border); border-radius:980px; background:var(--surface); color:var(--ink2); cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.lh-view-btn.active { background:var(--accent); color:var(--on-accent); border-color:var(--accent); box-shadow:0 2px 8px rgba(94,61,232,0.3); }

/* ── MOBILE OVERRIDES ──────────────────────────────────────────────────── */
@media (max-width:600px) {
  .mode-toggle { margin-top:1.5rem; }
  .mode-toggle { overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:0.4rem; justify-content:flex-start; scrollbar-width:none; }
  .mode-toggle::-webkit-scrollbar { display:none; }
  .toggle-wrap { flex-wrap:nowrap; width:max-content; max-width:none; border-radius:14px; }
  .toggle-btn { flex:none; border-radius:10px; font-size:max(12px,0.73rem); padding:0.42rem 0.65rem; white-space:nowrap; line-height:1.3; min-width:68px; }
  .hero { padding:2.2rem 1rem 1.6rem; }
  .hero h1 { font-size:1.65rem; }
  .hero-sub { font-size:0.84rem; }
  .entry-title,.lh-title { font-size:0.95rem; }
  .halacha-text,.torah-title { font-size:0.85rem; }
  .daily-banner { padding:1rem 1rem; }

  main { padding:1rem 0.6rem 4rem; }

  /* Entry/LH headers: ordered two-row layout
     Row 1: num · book · arrow (pinned right)
     Row 2: title (full width)
     Row 3: tefila badge (full width, only if present) */
  .entry-header, .lh-header {
    flex-wrap:wrap; padding:0.7rem 0.85rem 0.6rem; gap:0.3rem 0.4rem; align-items:center;
  }
  .entry-num { font-size:0.88rem; order:1; flex-shrink:0; }
  .entry-book { font-size:max(12px,0.62rem); padding:0.12rem 0.45rem; order:2; flex-shrink:0; }
  .card-toggle-arrow { order:3; margin-left:auto; flex-shrink:0; }
  .entry-title, .lh-title {
    order:4; flex:1 1 100%; white-space:normal; overflow:visible;
    text-overflow:unset; font-size:0.9rem; min-width:0;
  }
  .tefila-badge {
    order:5; font-size:max(12px,0.6rem); padding:0.1rem 0.42rem;
    flex-shrink:0; white-space:nowrap;
  }

  /* halacha-block header */
  .halacha-block-header {
    flex-wrap:wrap; padding:0.7rem 0.85rem 0.6rem; gap:0.3rem 0.4rem; align-items:center;
  }
  .halacha-block-name {
    white-space:normal; overflow:visible; text-overflow:unset;
    font-size:0.88rem; flex:1 1 calc(100% - 2.5rem); order:1; min-width:0;
  }
  .halacha-block-header .card-toggle-arrow { order:2; margin-left:0; flex-shrink:0; }
  .halacha-block-en { order:3; font-size:max(12px,0.68rem); flex:1 1 100%; }
  .hal-num-badge { font-size:max(12px,0.62rem); padding:0.1rem 0.45rem; order:0; flex-shrink:0; }

  /* parsha header */
  .parsha-header {
    flex-wrap:wrap; padding:0.7rem 0.85rem 0.6rem; gap:0.3rem 0.4rem; align-items:center;
  }
  .parsha-he { font-size:0.95rem; order:1; flex:1; white-space:nowrap; }
  .parsha-header .card-toggle-arrow { order:2; margin-left:auto; }
  .parsha-en { order:3; font-size:0.75rem; white-space:normal; flex:1 1 100%; }

  /* LT header */
  .lt-header {
    flex-wrap:wrap; padding:0.7rem 0.85rem 0.6rem; gap:0.3rem 0.4rem; align-items:center;
  }
  .lt-num { font-size:0.95rem; order:1; flex-shrink:0; }
  .lt-header .card-toggle-arrow { order:2; margin-left:auto; }
  .lt-label { order:3; font-size:max(12px,0.62rem); padding:0.1rem 0.45rem; flex:1 1 100%; }
  .lt-body { padding:0.5rem 0.85rem 0.7rem; }
  .lt-torah-title { font-size:0.85rem; }

  /* Topic chips — full-width stacked list, no pill shape */
  .topics-row { padding:0.5rem 0.85rem 0.6rem; gap:0; flex-direction:column; }
  .topic-chip {
    font-size:0.8rem; width:100%; display:flex; flex-wrap:wrap; gap:0.2rem;
    background:transparent; border:none; border-radius:0; padding:0.3rem 0;
    border-bottom:1px solid var(--border);
  }
  .topic-chip:last-child { border-bottom:none; }
  .topic-chip .topic-he { font-size:0.85rem; }
  .topic-chip .topic-tl { font-size:0.8rem; }
  .topic-chip .topic-meaning { font-size:0.75rem; }
  .topics-label { padding:0.6rem 0.85rem 0; font-size:max(12px,0.6rem); }

  /* Halacha/source items */
  .halacha-item, .torah-item, .halacha-source-item {
    padding:0.45rem 0.85rem; gap:0.3rem; flex-wrap:wrap;
  }
  .halacha-source-badge { font-size:max(12px,0.62rem); padding:0.1rem 0.45rem; flex-shrink:0; }
  .halacha-source-title { font-size:0.8rem; flex:1 1 100%; }
  /* LE eitza rows: let the summary read as a full-width paragraph on mobile
     (num + source badge sit on the top line; the text drops below full-width). */
  .le-eitza-item { flex-wrap:wrap; padding:0.5rem 0.85rem; }
  .le-eitza-sum { flex:1 1 100%; font-size:0.9rem; }
  .section-pill { font-size:max(12px,0.65rem); padding:0.15rem 0.5rem; }
  .halacha-text { font-size:0.82rem; }
  .torah-combined { font-size:max(12px,0.65rem); padding:0.15rem 0.5rem; flex-shrink:0; }
  .halachos-list, .torah-list { padding:0.2rem 0; }

  /* Parsha items */
  .parsha-torah-item { padding:0.4rem 0.85rem; flex-wrap:wrap; }
  .ps-lh-refs { font-size:max(12px,0.68rem); flex-basis:100%; }

  /* Filter buttons — horizontal scroll */
  .filters, .lh-sec-row { flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; padding-bottom:2px; }
  /* Filter chip strips: single-row horizontal scroll on mobile (override inline flex-wrap:wrap).
     "safe center" centres when the row fits but falls back to start so the first chip (All) is never clipped. */
  .filters-body .lh-sec-row { flex-wrap:nowrap !important; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; justify-content:safe center; scroll-padding-inline:14px; }
  .filters-body .lh-sec-row::-webkit-scrollbar { display:none; }
  .filters::-webkit-scrollbar, .lh-sec-row::-webkit-scrollbar { display:none; }
  .filter-btn, .sec-btn { font-size:max(12px,0.7rem); padding:0.25rem 0.65rem; flex:none; white-space:nowrap; }
  .lh-view-btn { font-size:max(12px,0.74rem); padding:0.28rem 0.75rem; }

  /* Daily banner */
  .daily-banner { padding:0.85rem; }
  .daily-grid { grid-template-columns:1fr; gap:0.5rem; }
  .daily-card { padding:0.7rem 0.85rem; }
  .daily-card-main { font-size:0.95rem; }
}
.daily-card-soon { font-size:0.8rem; color:var(--ink2); font-style:italic; direction:ltr; }
.daily-explore-btn { margin-top:0.5rem; font-family:inherit; font-size:max(12px,0.72rem); font-weight:600; padding:0.3rem 0.8rem; border:1.5px solid var(--border); border-radius:980px; background:transparent; color:var(--ink2); cursor:pointer; direction:ltr; transition:all 0.15s; }
.daily-explore-btn:hover { background:var(--ink); color:#fff; border-color:var(--ink); }
.daily-assoc-wrap { margin-top:0.5rem; border-top:1px solid var(--border); padding-top:0.4rem; display:flex; flex-direction:column; gap:0.3rem; }
.daily-assoc-group { display:flex; flex-direction:column; gap:0.2rem; }
.daily-assoc-label { font-size:max(12px,0.62rem); font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--ink3); direction:rtl; padding-top:0.15rem; }
.daily-assoc-item { direction:rtl; }
.daily-assoc-pill { display:inline-block; font-size:max(12px,0.72rem); padding:0.15rem 0.5rem; border-radius:6px; line-height:1.4; }
.daily-assoc-lh { background:rgba(0,119,237,0.08); color:#0077ed; }
.daily-assoc-lt { background:rgba(185,100,0,0.1); color:#b96400; }
.daily-assoc-le { background:rgba(0,134,42,0.08); color:#005a1c; }
.daily-assoc-ps { background:rgba(100,50,200,0.08); color:#6432c8; }

/* ── ANATOMY OF THE SOUL TOGGLE ─────────────────────────────────────────── */
.aos-toggle-btn.active { background:var(--aos) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(94,61,232,0.35) !important; }
.aos-toggle-btn:not(.active):hover { background:var(--aos-light) !important; color:var(--aos) !important; }
.str-toggle-btn.active { background:var(--str) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(139,69,19,0.35) !important; }
.str-toggle-btn:not(.active):hover { background:var(--str-light) !important; color:var(--str) !important; }
.ym-toggle-btn.active { background:var(--ym) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(138,59,82,0.35) !important; }
.ym-toggle-btn:not(.active):hover { background:var(--ym-light) !important; color:var(--ym) !important; }
.ym-chip { display:inline-flex; align-items:center; padding:2px 10px; border-radius:980px; font-size:max(12px,0.7rem); font-weight:600; background:var(--ym-light); color:var(--ym); border:1px solid var(--ym-mid); direction:ltr; }
.ym-entry .entry-book { color:var(--ym); }

/* AOS main entry cards */
.aos-entry {
  background:var(--surface); border-radius:var(--radius); margin-bottom:0.75rem;
  overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border);
  transition:box-shadow 0.2s, transform 0.15s;
}
.aos-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.aos-entry-header {
  display:flex; align-items:center; gap:0.75rem;
  padding:0.9rem 1.2rem 0.75rem; border-bottom:1px solid var(--border);
  cursor:pointer; user-select:none; transition:background 0.12s;
}
.aos-entry-header:hover { background:var(--aos-light); }
.aos-entry:not(.open) .aos-entry-header { border-bottom:none; }
.aos-entry:not(.open) .aos-entry-body { display:none; }
.aos-entry.open .aos-arrow { transform:rotate(180deg); background:var(--aos); color:var(--on-accent); border-color:var(--aos); }
.aos-bp-he { font-size:1rem; font-weight:700; color:var(--ink); }
.aos-bp-en { font-size:0.82rem; font-weight:400; color:var(--ink2); direction:ltr; }
.aos-arrow {
  margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center;
  justify-content:center; border-radius:50%; background:var(--aos-light);
  border:1.5px solid rgba(139,92,246,0.2); color:var(--aos); font-size:1rem; flex-shrink:0;
  transition:transform 0.2s, background 0.15s;
}

/* AOS entry body sections */
.aos-entry-body { padding:0; }
.aos-section-label {
  font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--aos);
  text-transform:uppercase; padding:0.7rem 1.2rem 0;
}
.aos-full-panel { padding:0; }
.aos-full-depth-btns { display:flex; gap:0.3rem; padding:0.55rem 1.2rem 0; flex-wrap:wrap; }
.aos-depth-btn {
  font-family:inherit; font-size:max(12px,0.72rem); font-weight:600;
  padding:0.28rem 0.75rem; border:1.5px solid rgba(139,92,246,0.25);
  border-radius:980px; background:var(--surface); color:var(--aos2);
  cursor:pointer; transition:all 0.15s; white-space:nowrap;
}
.aos-depth-btn.active { background:var(--aos); color:var(--on-accent); border-color:var(--aos); }
.aos-depth-btn:hover:not(.active) { border-color:var(--aos); color:var(--aos); }
.aos-full-text {
  padding:0.65rem 1.2rem 0.55rem; font-size:0.9rem; line-height:1.7;
  color:var(--ink); direction:ltr;
}
.aos-source {
  font-size:max(12px,0.68rem); color:var(--ink3); font-style:italic;
  padding:0 1.2rem 0.85rem; direction:ltr;
}
.aos-torah-ref {
  display:flex; align-items:center; gap:0.5rem; padding:0.5rem 1.2rem;
  border-bottom:1px solid var(--border); flex-wrap:wrap; transition:background 0.12s;
}
.aos-torah-ref:hover { background:var(--aos-light); }
.aos-torah-ref:last-child { border-bottom:none; }

/* AOS label/row inside LM cards — matches eitzos/topics style exactly */
.aos-label {
  font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em;
  color:var(--aos); text-transform:uppercase; padding:0.7rem 1.2rem 0;
}
.aos-row {
  display:flex; flex-direction:column; gap:0.25rem;
  padding:0.6rem 1.2rem 0.75rem;
  border-top:1px solid rgba(139,92,246,0.08);
  background:rgba(139,92,246,0.03);
}
.aos-row .topic-chip .topic-he { color:var(--aos) !important; }
.aos-row .topic-chip .topic-tl { color:var(--aos2) !important; }

@media (max-width:600px) {
  .aos-entry-header { padding:0.75rem 0.85rem 0.6rem; }
  .aos-full-text { padding:0.55rem 0.85rem 0.5rem; font-size:0.86rem; }
  .aos-full-depth-btns { padding:0.5rem 0.85rem 0; }
  .aos-section-label { padding:0.6rem 0.85rem 0; }
  .aos-source { padding:0 0.85rem 0.75rem; }
  .aos-torah-ref { padding:0.45rem 0.85rem; }
  .aos-label { padding:0.6rem 0.85rem 0; }
  .aos-row { padding:0.5rem 0.85rem 0.65rem; }
}

/* ── Collapsible section intro ──────────────────────────────────────────── */
.intro-collapse { margin-bottom:1.1rem; }
.intro-collapse-bar {
  display:flex; align-items:center; gap:0.55rem; width:100%;
  font-family:inherit; font-size:0.9rem; font-weight:700; text-align:left;
  padding:0.7rem 1rem; cursor:pointer;
  background:var(--surface); color:var(--ic-accent,#555);
  border:1px solid var(--border); border-radius:12px;
  box-shadow:var(--shadow-sm); transition:background 0.15s, box-shadow 0.15s;
}
.intro-collapse-bar:hover { box-shadow:var(--shadow-md); }
.ic-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:1.4rem; height:1.4rem; flex-shrink:0; border-radius:50%;
  background:var(--ic-accent,#888); color:#fff; font-size:0.8rem; font-weight:700; font-style:normal;
}
.ic-label { flex:1; min-width:0; direction:ltr; }
.ic-chevron { flex-shrink:0; font-size:1.1rem; line-height:1; transition:transform 0.2s; color:var(--ic-accent,#888); }
.intro-collapse.open .ic-chevron { transform:rotate(180deg); }
.intro-collapse.open .intro-collapse-body { margin-top:0.6rem; }
.intro-collapse:not(.open) .intro-collapse-body { display:none; }
@media (max-width:600px) {
  .intro-collapse-bar { font-size:0.84rem; padding:0.65rem 0.85rem; }
}

/* ── HISBODEDUS ─────────────────────────────────────────────────────────── */
.his-toggle-btn.active { background:var(--his) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(15,138,120,0.35) !important; }
.his-toggle-btn:not(.active):hover { background:var(--his-light) !important; color:var(--his) !important; }

/* Intro hero panel */
.his-intro {
  position:relative; overflow:hidden;
  background:linear-gradient(155deg, var(--his) 0%, var(--his2) 100%);
  border-radius:var(--radius); padding:1.6rem 1.5rem 1.5rem;
  margin-bottom:1.1rem; box-shadow:var(--shadow-md);
}
.his-intro-kicker {
  font-size:max(12px,0.66rem); font-weight:800; letter-spacing:0.14em; text-transform:uppercase;
  color:rgba(255,255,255,0.82); margin-bottom:0.35rem;
}
.his-intro-he { font-size:1.5rem; font-weight:800; color:#fff; line-height:1.2; }
.his-intro-en { font-size:0.92rem; font-weight:600; color:rgba(255,255,255,0.9); direction:ltr; margin-top:0.15rem; }
.his-intro-body {
  position:relative; z-index:1; margin-top:0.9rem; font-size:0.93rem; line-height:1.72;
  color:rgba(255,255,255,0.96); direction:ltr; max-width:62ch;
}
.his-intro-body strong { color:#fff; font-weight:700; }
.his-intro-quote {
  position:relative; z-index:1; margin:0.95rem 0 0; padding:0.7rem 0.95rem;
  border-left:3px solid rgba(255,255,255,0.55); border-radius:0 8px 8px 0;
  background:rgba(255,255,255,0.10); direction:ltr; max-width:62ch;
  font-size:0.92rem; line-height:1.6; font-style:italic; color:#fff;
}
.his-intro-quote em { font-style:normal; opacity:0.92; }
.his-intro-source {
  position:relative; z-index:1; margin-top:0.85rem; font-size:max(12px,0.72rem); font-style:italic;
  color:rgba(255,255,255,0.8); direction:ltr;
}
.his-intro-seebelow {
  margin:0.95rem 0 1.1rem; padding:0.65rem 0.9rem; direction:ltr;
  background:var(--his-light); border:1px solid var(--his-mid); border-radius:10px;
  font-size:0.86rem; line-height:1.6; color:var(--ink);
}
.his-intro-seebelow strong { color:var(--his); font-weight:700; }
.his-intro-seebelow .sb-arrow { color:var(--his); font-weight:800; }
.his-list-label {
  font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--his);
  text-transform:uppercase; padding:0.2rem 0.2rem 0.6rem; direction:ltr;
}
.his-view-row { display:flex; gap:0.45rem; flex-wrap:wrap; margin-bottom:1rem; }
.his-view-btn {
  font-family:inherit; font-size:0.82rem; font-weight:600; padding:0.4rem 1rem;
  border:1.5px solid var(--his-mid); border-radius:980px; background:var(--surface);
  color:var(--his); cursor:pointer; transition:all 0.15s; white-space:nowrap;
}
.his-view-btn.active { background:var(--his); color:var(--on-accent); border-color:var(--his); box-shadow:0 2px 8px rgba(15,138,120,0.3); }
.his-view-btn:not(.active):hover { background:var(--his-light); }
/* Short line under the view row saying what the selected view is for — so nobody
   has to know a sefer's name to find their way around the section. */
.his-view-blurb {
  direction:ltr; text-align:left; font-size:0.86rem; line-height:1.6; color:var(--ink2);
  background:var(--his-light); border:1px solid var(--his-mid); border-radius:10px;
  padding:0.65rem 0.85rem; margin:-0.4rem 0 1rem;
}
.his-view-blurb strong { color:var(--his); font-weight:700; }
/* The sefer each card comes from (cards are now grouped by purpose, not by book). */
.his-sef {
  flex-shrink:0; max-width:9.5rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:max(12px,0.66rem); font-weight:700; letter-spacing:0.02em; direction:ltr;
  color:var(--his); background:var(--his-light); border:1px solid var(--his-mid);
  border-radius:980px; padding:0.22rem 0.6rem;
}
/* The "seforim behind this section" hero card */
.his-sefer-list { direction:ltr; text-align:left; }
.his-sefer-item { padding:0.7rem 0; border-bottom:1px solid var(--border); }
.his-sefer-item:last-child { border-bottom:none; }
.his-sefer-name { font-size:0.92rem; font-weight:700; color:var(--ink); }
.his-sefer-by { font-size:0.78rem; font-weight:600; color:var(--his); margin:0.1rem 0 0.35rem; }
.his-sefer-txt { font-size:0.86rem; line-height:1.7; color:var(--ink2); }
@media (max-width:520px){
  .his-sef { max-width:6.5rem; font-size:max(12px,0.62rem); padding:0.2rem 0.5rem; }
}

/* Tzaddik cards (mirror aos-entry) */
.his-entry {
  background:var(--surface); border-radius:var(--radius); margin-bottom:0.7rem;
  overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border);
  transition:box-shadow 0.2s, transform 0.15s;
}
.his-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.his-entry-header {
  display:flex; align-items:center; gap:0.75rem;
  padding:0.85rem 1.2rem; cursor:pointer; user-select:none; transition:background 0.12s;
}
.his-entry-header:hover { background:var(--his-light); }
.his-entry:not(.open) .his-entry-body { display:none; }
.his-entry.open .his-entry-header { border-bottom:1px solid var(--border); }
.his-entry.open .his-arrow { transform:rotate(180deg); background:var(--his); color:var(--on-accent); border-color:var(--his); }
.his-index {
  width:1.7rem; height:1.7rem; flex-shrink:0; border-radius:50%;
  background:var(--his-light); color:var(--his); font-size:0.78rem; font-weight:700;
  display:flex; align-items:center; justify-content:center; border:1.5px solid var(--his-mid);
}
/* The text block in a Hisbodedus card header (Hebrew line + English line).
   This used to be an inline style="…flex:1;min-width:0;" on the div, which meant the
   mobile rule below could never override it — inline styles beat stylesheet rules, media
   query or not — so the title stayed crushed into a two-word column. It is a class now. */
.his-head-txt { display:flex; flex-direction:column; gap:0.1rem; flex:1; min-width:0; }
.his-name-he { font-size:1.05rem; font-weight:700; color:var(--ink); }
.his-name-en { font-size:0.8rem; font-weight:500; color:var(--ink2); direction:ltr; }
.his-arrow {
  margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center;
  justify-content:center; border-radius:50%; background:var(--his-light);
  border:1.5px solid var(--his-mid); color:var(--his); font-size:1rem; flex-shrink:0;
  transition:transform 0.2s, background 0.15s;
}
.his-entry-body { padding:0.2rem 1.2rem 1rem; }
.his-summary { font-size:0.92rem; line-height:1.72; color:var(--ink); direction:ltr; padding-top:0.7rem; }
.his-src-label {
  font-size:max(12px,0.63rem); font-weight:700; letter-spacing:0.08em; color:var(--his);
  text-transform:uppercase; margin-top:0.85rem; margin-bottom:0.4rem; direction:ltr;
}
.his-src-row { display:flex; flex-wrap:wrap; gap:0.4rem; direction:ltr; }
.his-src-link {
  display:inline-flex; align-items:center; gap:0.3rem; text-decoration:none;
  font-size:0.78rem; font-weight:600; color:var(--his);
  background:var(--his-light); border:1.5px solid var(--his-mid);
  border-radius:980px; padding:0.3rem 0.75rem; transition:all 0.14s;
}
.his-src-link:hover { background:var(--his); color:var(--on-accent); border-color:var(--his); }
.his-src-plain {
  display:inline-flex; align-items:center; font-size:0.78rem; font-weight:500;
  color:var(--ink2); background:var(--surface2); border:1px solid var(--border);
  border-radius:980px; padding:0.3rem 0.75rem;
}
/* Hero-card note pointing to the Starters view */
.his-intro-cta {
  position:relative; z-index:1; margin-top:1rem; padding:0.7rem 0.95rem; cursor:pointer;
  background:rgba(255,255,255,0.14); border:1px solid rgba(255,255,255,0.32);
  border-radius:10px; direction:ltr; font-size:0.88rem; line-height:1.55;
  color:#fff; transition:background 0.15s;
}
.his-intro-cta:hover { background:rgba(255,255,255,0.22); }
.his-intro-cta strong { font-weight:800; color:#fff; }
.his-intro-cta .his-cta-go { font-weight:700; white-space:nowrap; opacity:0.95; }
/* Hisbodedus Starters */
.str-blurb {
  margin:0 0 1rem; padding:0.85rem 1rem; direction:ltr;
  background:var(--his-light); border:1px solid var(--his-mid); border-radius:12px;
  font-size:0.9rem; line-height:1.65; color:var(--ink);
}
.str-blurb strong { color:var(--his); font-weight:700; }
.str-title { font-size:1.02rem; font-weight:700; color:var(--ink); direction:ltr; line-height:1.32; }
.str-lead { font-size:0.92rem; line-height:1.7; color:var(--ink); direction:ltr; padding-top:0.7rem; }
.str-fill { margin:0.75rem 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:0.4rem; direction:ltr; }
.str-fill li {
  background:var(--his-light); border:1px solid var(--his-mid); border-radius:10px;
  padding:0.45rem 0.8rem; font-size:0.88rem; line-height:1.5; color:var(--ink); font-style:italic;
}
.str-credit {
  margin:1.3rem 0 0.3rem; padding:1rem 1rem 1.1rem; text-align:center; direction:ltr;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-sm);
}
.str-credit-label { font-size:max(12px,0.66rem); font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink2); }
.str-credit-name { font-size:1.05rem; font-weight:800; color:var(--his); margin-top:0.25rem; }
.str-credit-tag {
  display:inline-block; margin-top:0.5rem; padding:0.28rem 0.85rem; border-radius:980px;
  background:var(--his-light); border:1px solid var(--his-mid);
  font-size:0.8rem; font-weight:600; font-style:italic; color:var(--his); letter-spacing:0.02em;
}
/* Where Earth and Heaven Kiss — "A note for today" box (a modern application,
   clearly set apart from the sefer's own words) + its cross-reference chips. */
.weh-note {
  margin-top:1rem; padding:0.85rem 1rem; direction:ltr; text-align:left;
  background:var(--surface2); border:1px dashed var(--border);
  border-left:3px solid var(--his); border-radius:12px;
}
.weh-note-label {
  font-size:max(12px,0.63rem); font-weight:800; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--his); margin-bottom:0.45rem;
}
.weh-note p { margin:0 0 0.65rem; font-size:0.88rem; line-height:1.72; color:var(--ink); }
.weh-note p:last-child { margin-bottom:0; }
.weh-note strong { font-weight:700; color:var(--ink); }
.weh-xref-label {
  font-size:max(12px,0.63rem); font-weight:700; letter-spacing:0.08em; color:var(--his);
  text-transform:uppercase; margin-top:0.85rem; margin-bottom:0.4rem; direction:ltr;
}
.weh-xref { display:flex; flex-wrap:wrap; gap:0.4rem; direction:ltr; }
.weh-xref-chip {
  display:inline-flex; align-items:center; cursor:pointer;
  font-size:0.78rem; font-weight:600; font-family:var(--font-ui);
  color:var(--accent); background:var(--accent-light);
  border:1.5px solid var(--accent-mid); border-radius:980px;
  padding:0.3rem 0.75rem; transition:all 0.14s;
}
.weh-xref-chip:hover { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
@media (max-width:600px) {
  .weh-note { padding:0.75rem 0.85rem; }
  .weh-note p { font-size:0.85rem; }
  /* The English sefer pill is longer than the Hebrew ones — let it shrink so the
     card title keeps its room on a narrow screen. */
  .sim-entry .entry-book { max-width:42%; flex-shrink:1; overflow:hidden; text-overflow:ellipsis; }
  .his-intro { padding:1.3rem 1.1rem; }
  .his-intro-he { font-size:1.25rem; }
  .his-intro-body { font-size:0.88rem; }
  .his-entry-header { padding:0.75rem 0.85rem; }
  .his-entry-body { padding:0.2rem 0.85rem 0.85rem; }
}

/* Hisbodedus card headers on a narrow screen ──────────────────────────────
   The header is one flex row: [★][share][number][sefer pill][title][▾]. On a
   phone the five fixed items ate almost the whole row, leaving the title a
   column two or three words wide, so a card title such as "Hashem, I don't know
   what I'm feeling, but I'm here." came out one word per line. Let the header
   wrap and give the title a full-width line of its own underneath the pills —
   the controls stay on the top line, the title reads normally. */
@media (max-width:700px) {
  .his-entry-header { flex-wrap:wrap; row-gap:0.45rem; }
  .his-entry-header > .fav-star,
  .his-entry-header > .share-btn,
  .his-entry-header > .fav-goto-btn,
  .his-entry-header > .his-index,
  .his-entry-header > .his-sef { order:1; }
  .his-entry-header > .his-arrow { order:2; }
  .his-entry-header > .his-head-txt,
  .his-entry-header > div { order:3; flex:1 1 100%; min-width:100%; direction:ltr; text-align:left; }
  /* Now that the pill shares the top line with the controls, let it shrink to
     fit (it already ellipsises) rather than push the row into an overflow. */
  .his-sef { max-width:none; flex-shrink:1; }
}

/* ── SHEVACH HATZADDIKIM L'RABBEINU ─────────────────────────────────────── */
.shtz-toggle-btn.active { background:var(--shtz) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(169,121,27,0.35) !important; }
.shtz-toggle-btn:not(.active):hover { background:var(--shtz-light) !important; color:var(--shtz) !important; }

/* ── YESODOS HAKABBALAH · KABBALAH BASICS ────────────────────────────────── */
.kab-toggle-btn.active { background:var(--kab) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(36,86,201,0.35) !important; }
.kab-toggle-btn:not(.active):hover { background:var(--kab-light) !important; color:var(--kab) !important; }
/* accent the standard card chrome when in the kab section */
.kab-entry.open .card-toggle-arrow { transform:rotate(180deg); background:var(--kab) !important; color:var(--on-accent) !important; border-color:var(--kab) !important; }
.kab-entry .entry-num { color:var(--kab); }
.kab-entry .entry-book { background:var(--kab-light); color:var(--kab); }
/* show the English name even while the card is collapsed (and let long titles wrap) */
.kab-entry .entry-title { white-space:normal; overflow:visible; text-overflow:clip; }
.kab-entry .entry-title-en { display:inline; font-size:0.78rem; font-weight:400; color:var(--ink2); direction:ltr; }
.kab-body { display:none; padding:0 1.2rem 1rem; direction:ltr; text-align:left; }
.kab-entry.open .kab-body { display:block; }
.kab-sec-label { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--kab); margin:0.9rem 0 0.35rem; }
.kab-body p { font-size:0.92rem; color:var(--ink); line-height:1.7; margin:0.5rem 0; }
.kab-body .kab-he { font-family:var(--font-ui); direction:rtl; unicode-bidi:isolate; }
.kab-body em { color:var(--ink2); font-style:italic; }
.kab-source { padding:0.7rem 0 0; font-size:max(12px,0.7rem); color:var(--ink3); font-style:italic; }
/* per-lens mini list (the 10/7/5 rows inside a topic card) */
.kab-minilist { display:flex; flex-direction:column; gap:4px; margin:0.4rem 0 0.2rem; }
.kab-mini-row { display:flex; align-items:baseline; gap:8px; padding:6px 10px; border:1px solid var(--border); border-radius:10px; background:var(--surface2); }
.kab-mini-key { font-weight:700; color:var(--kab); min-width:104px; flex-shrink:0; font-size:0.86rem; }
.kab-mini-key .kab-he { font-size:0.95rem; }
.kab-mini-val { font-size:0.85rem; color:var(--ink); line-height:1.5; }
/* interactive reference grid */
.kab-chart-pills { display:flex; flex-wrap:wrap; gap:6px; margin:0.3rem 0 0.8rem; justify-content:safe center; direction:rtl; }
.kab-pill { cursor:pointer; border:1.5px solid var(--border); background:var(--surface2); color:var(--ink2); border-radius:980px; padding:5px 13px; font-size:0.82rem; font-weight:600; transition:all 0.15s; }
.kab-pill:hover { border-color:var(--kab); color:var(--kab); }
.kab-pill.active { background:var(--kab); color:var(--on-accent); border-color:var(--kab); }
.kab-pill .kab-he { font-size:0.95rem; }
.kab-detail { border:1px solid var(--border); border-radius:14px; overflow:hidden; background:var(--surface); margin-bottom:1rem; }
.kab-detail-head { background:var(--kab-light); padding:12px 16px; border-bottom:1px solid var(--border); }
.kab-detail-head .he { font-size:1.3rem; font-weight:700; color:var(--kab); direction:rtl; }
.kab-detail-head .en { font-size:0.85rem; color:var(--ink2); }
.kab-detail-row { display:flex; gap:10px; padding:9px 16px; border-bottom:1px solid var(--border); }
.kab-detail-row:last-child { border-bottom:none; }
.kab-detail-row .k { font-weight:700; color:var(--kab); min-width:120px; flex-shrink:0; font-size:0.82rem; }
.kab-detail-row .v { font-size:0.9rem; color:var(--ink); line-height:1.5; }
.kab-detail-row .v .kab-he { font-size:1.02rem; }
.kab-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--border); border-radius:12px; margin-top:0.5rem; }
.kab-table { border-collapse:collapse; width:100%; font-size:0.8rem; min-width:680px; }
.kab-table th, .kab-table td { border:1px solid var(--border); padding:6px 9px; text-align:left; white-space:nowrap; }
.kab-table thead th { background:var(--kab); color:var(--on-accent); font-weight:700; position:sticky; top:0; }
.kab-table tbody tr:nth-child(even) { background:var(--surface2); }
.kab-table .kab-he { font-size:0.92rem; }
.kab-table-hint { font-size:max(12px,0.72rem); color:var(--ink3); font-style:italic; margin-top:4px; }
@media (max-width:600px){
  .kab-detail-row { flex-direction:column; gap:1px; }
  .kab-detail-row .k { min-width:0; }
  .kab-mini-row { flex-direction:column; gap:1px; }
  .kab-mini-key { min-width:0; }
}
/* ── MESHIVAS NEFESH · RESTORER OF THE SOUL ──────────────────────────────── */
.mn-toggle-btn.active { background:var(--mn) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(194,69,110,0.35) !important; }
.mn-toggle-btn:not(.active):hover { background:var(--mn-light) !important; color:var(--mn) !important; }
.cn-toggle-btn.active { background:var(--cn) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(194,65,12,0.35) !important; }
.cn-toggle-btn:not(.active):hover { background:var(--cn-light) !important; color:var(--cn) !important; }
.mn-entry .entry-num { color:var(--mn); }
.mn-entry .entry-book { background:var(--mn-light); color:var(--mn); }
.mn-entry.open .card-toggle-arrow { transform:rotate(180deg); background:var(--mn) !important; color:var(--on-accent) !important; border-color:var(--mn) !important; }
.mn-entry .entry-title { direction:ltr; text-align:left; }
.mn-entry.open .entry-title { white-space:normal; overflow:visible; text-overflow:clip; }
.mn-body { display:none; padding:0 1.2rem 1rem; direction:ltr; text-align:left; }
.mn-entry.open .mn-body { display:block; }
/* Pearls of Wisdom cards reuse the .mn-body layout but their own teal accent */
.pw-entry .entry-num { color:var(--pw); }
.pw-entry .entry-book { background:var(--pw-light); color:var(--pw); }
.pw-entry.open .card-toggle-arrow { transform:rotate(180deg); background:var(--pw) !important; color:var(--on-accent) !important; border-color:var(--pw) !important; }
.pw-entry .entry-title { direction:ltr; text-align:left; }
.pw-entry.open .entry-title { white-space:normal; overflow:visible; text-overflow:clip; }
.pw-entry.open .mn-body { display:block; }
.al-entry .entry-num { color:var(--accent); }
.al-entry .entry-book { background:var(--accent-light); color:var(--accent); }
.al-entry.open .card-toggle-arrow { transform:rotate(180deg); background:var(--accent) !important; color:var(--on-accent) !important; border-color:var(--accent) !important; }
.al-entry .entry-title { direction:ltr; text-align:left; }
.al-entry.open .entry-title { white-space:normal; overflow:visible; text-overflow:clip; }
.al-entry .al-body { display:none; padding:0 16px 14px 60px; direction:ltr; text-align:left; }
.al-entry.open .al-body { display:block; }
.mn-theme-label { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--mn); margin:0.2rem 0 0.6rem; }
.mn-he { font-family:var(--font-ui); direction:rtl; unicode-bidi:isolate; text-align:right; font-size:1.2rem; line-height:1.95; color:var(--ink); background:var(--mn-light); border-right:3px solid var(--mn); border-radius:8px; padding:0.75rem 1rem; margin-bottom:0.7rem; }
.mn-en { direction:ltr; text-align:left; font-size:0.95rem; color:var(--ink); line-height:1.7; margin-bottom:0.2rem; }
.mn-ctx { direction:ltr; text-align:left; font-size:0.85rem; color:var(--ink2); font-style:italic; line-height:1.65; margin-top:0.85rem; padding-top:0.75rem; border-top:1px solid var(--border); }
.mn-ctx-label { display:block; font-style:normal; font-size:max(12px,0.64rem); font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--mn); margin-bottom:0.2rem; }
.mn-source { direction:ltr; text-align:left; font-size:0.78rem; color:var(--ink3); margin-top:0.8rem; padding-top:0.55rem; border-top:1px solid var(--border); }
.mn-srclink { color:var(--mn); font-weight:600; cursor:pointer; }
.mn-srclink:hover { text-decoration:underline; }
.mn-source-extra { color:var(--ink3); font-style:italic; }
/* hero / intro card */
.mn-intro { padding:2px 2px 4px; direction:ltr; text-align:left; }
.mn-intro-kicker { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--mn); margin-bottom:0.5rem; direction:ltr; text-align:left; }
.mn-intro-he { font-family:var(--font-ui); direction:rtl; text-align:right; font-size:1.9rem; font-weight:700; color:var(--mn); line-height:1.2; }
.mn-intro-en { font-size:0.9rem; font-weight:600; color:var(--ink2); margin:0.15rem 0 0.9rem; direction:ltr; text-align:left; }
.mn-intro-body { font-size:0.9rem; color:var(--ink); line-height:1.7; margin-bottom:0.8rem; direction:ltr; text-align:left; }
.mn-intro-quote { background:var(--mn-light); border-radius:12px; padding:0.85rem 1rem; margin:0.4rem 0 0.9rem; text-align:center; direction:ltr; }
.mn-intro-quote .q-he { font-family:var(--font-ui); direction:rtl; font-size:1.25rem; font-weight:700; color:var(--mn); display:block; line-height:1.7; }
.mn-intro-quote .q-en { font-size:0.82rem; color:var(--ink2); font-style:italic; display:block; margin-top:0.3rem; }
.mn-intro-note { font-size:0.8rem; color:var(--ink3); line-height:1.6; direction:ltr; text-align:left; }
/* ── SIMCHA (שִׂמְחָה) — thematic collection from the seforim of Rav A. Tzvi Kluger ── */
.sim-toggle-btn.active { background:var(--sim) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(199,122,18,0.35) !important; }
.sim-toggle-btn:not(.active):hover { background:var(--sim-light) !important; color:var(--sim) !important; }
.pw-toggle-btn.active { background:var(--pw) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(14,116,144,0.35) !important; }
.pw-toggle-btn:not(.active):hover { background:var(--pw-light) !important; color:var(--pw) !important; }
.sim-entry .entry-num { color:var(--sim); }
.sim-entry .entry-book { background:var(--sim-light); color:var(--sim); }
.sim-entry.open .card-toggle-arrow { transform:rotate(180deg); background:var(--sim) !important; color:var(--on-accent) !important; border-color:var(--sim) !important; }
.sim-entry .entry-title { direction:ltr; text-align:left; }
.sim-entry.open .entry-title { white-space:normal; overflow:visible; text-overflow:clip; }
.sim-body { display:none; padding:0 1.2rem 1rem; direction:ltr; text-align:left; }
.sim-entry.open .sim-body { display:block; }
.sim-chapter { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--sim); margin:0.2rem 0 0.6rem; }
.sim-en { direction:ltr; text-align:left; font-size:0.95rem; color:var(--ink); line-height:1.75; }
.sim-en .sim-he-term { font-family:var(--font-ui); }
.sim-source { direction:ltr; text-align:left; font-size:0.78rem; color:var(--ink3); margin-top:0.85rem; padding-top:0.55rem; border-top:1px solid var(--border); }
.sim-intro { padding:2px 2px 4px; direction:ltr; text-align:left; }
.sim-intro-kicker { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--sim); margin-bottom:0.5rem; direction:ltr; text-align:left; }
.sim-intro-he { font-family:var(--font-ui); direction:rtl; text-align:right; font-size:1.9rem; font-weight:700; color:var(--sim); line-height:1.2; }
.sim-intro-en { font-size:0.9rem; font-weight:600; color:var(--ink2); margin:0.15rem 0 0.9rem; direction:ltr; text-align:left; }
.sim-intro-body { font-size:0.9rem; color:var(--ink); line-height:1.7; margin-bottom:0.8rem; direction:ltr; text-align:left; }
.sim-intro-quote { background:var(--sim-light); border-radius:12px; padding:0.85rem 1rem; margin:0.4rem 0 0.9rem; text-align:center; direction:ltr; }
.sim-intro-quote .q-he { font-family:var(--font-ui); direction:rtl; font-size:1.25rem; font-weight:700; color:var(--sim); display:block; line-height:1.7; }
.sim-intro-quote .q-en { font-size:0.82rem; color:var(--ink2); font-style:italic; display:block; margin-top:0.3rem; }
.sim-intro-note { font-size:0.8rem; color:var(--ink3); line-height:1.6; direction:ltr; text-align:left; }
/* ── TIKKUN CHATZOS (תִּקּוּן חֲצוֹת) — midnight-indigo accent ── */
.tc-toggle-btn.active { background:var(--tc) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(59,61,140,0.35) !important; }
.tc-toggle-btn:not(.active):hover { background:var(--tc-light) !important; color:var(--tc) !important; }
.tc-entry .entry-num { color:var(--tc); }
.tc-entry .entry-book { background:var(--tc-light); color:var(--tc); }
.tc-entry.open .card-toggle-arrow { transform:rotate(180deg); background:var(--tc) !important; color:var(--on-accent) !important; border-color:var(--tc) !important; }
.tc-entry .entry-title { direction:ltr; text-align:left; }
.tc-entry.open .entry-title { white-space:normal; overflow:visible; text-overflow:clip; }
/* Reb Noson's Life (Yemei Moharnat) — titles always left-justified (LTR) and wrap
   fully so a long title is never clipped, whether the card is collapsed or open. */
.ym-entry .entry-title { direction:ltr; text-align:left; white-space:normal; overflow:visible; text-overflow:clip; }
.tc-body { display:none; padding:0 1.2rem 1rem; direction:ltr; text-align:left; }
.tc-entry.open .tc-body { display:block; }
.tc-chapter { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--tc); margin:0.2rem 0 0.6rem; }
.tc-en { direction:ltr; text-align:left; font-size:0.95rem; color:var(--ink); line-height:1.75; }
.tc-en .tc-he-term { font-family:var(--font-ui); }
.tc-source { direction:ltr; text-align:left; font-size:0.78rem; color:var(--ink3); margin-top:0.85rem; padding-top:0.55rem; border-top:1px solid var(--border); }
.tc-refs { margin-top:0.7rem; display:flex; flex-wrap:wrap; gap:6px; }
.tc-refs .tc-ref-link { cursor:pointer; font-size:0.76rem; font-weight:600; color:var(--tc); background:var(--tc-light); border:1px solid var(--tc-mid); border-radius:999px; padding:3px 10px; direction:ltr; }
.tc-refs .tc-ref-link:hover { background:var(--tc-mid); }
/* ── Chatzos calculator card (tool card — always shown at the top of Tikkun Chatzos) ── */
.tc-calc .entry-num { display:flex; align-items:center; color:var(--tc); }
.tc-calc .entry-num svg { display:block; }
.tc-calc-body { display:none; padding:0 1.2rem 1.1rem; direction:ltr; text-align:left; }
.tc-calc.open .tc-calc-body { display:block; }
.tcc-status { font-size:0.78rem; color:var(--ink2); direction:ltr; text-align:left; margin:0.6rem 0 0.7rem; line-height:1.5; }
.tcc-status strong { color:var(--ink); font-weight:700; }
.tcc-msg { font-size:0.78rem; color:var(--ink); line-height:1.55; direction:ltr; text-align:left; background:var(--surface2); border:1.5px solid var(--border); border-radius:10px; padding:0.6rem 0.75rem; margin:0 0 0.75rem; }
.tcc-hero { background:var(--tc-fill); border:1.5px solid var(--tc-line); border-radius:14px; padding:1rem 1.1rem; text-align:center; direction:ltr; }
.tcc-hero-label { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--tc); }
.tcc-hero-time { font-family:var(--font-ui); font-size:2.5rem; font-weight:700; color:var(--tc); line-height:1.2; margin:0.15rem 0 0.1rem; direction:ltr; font-variant-numeric:tabular-nums; }
.tcc-hero-date { font-size:0.8rem; font-weight:600; color:var(--ink); direction:ltr; }
.tcc-hero-rule { display:inline-block; margin-top:0.6rem; font-size:max(12px,0.72rem); font-weight:700; color:var(--tc); background:var(--surface); border:1.5px solid var(--tc-line); border-radius:999px; padding:3px 11px; direction:ltr; }
.tcc-flag { background:var(--surface2); border:1px solid var(--border); border-left:3px solid var(--tc); border-radius:12px; padding:0.8rem 0.95rem; font-size:0.85rem; color:var(--ink2); line-height:1.6; direction:ltr; text-align:left; }
/* The verdict block sits directly under the Chatzos time and is centred to match
   it — it is the answer, not prose. (The rows of working below stay left/right.) */
.tcc-tonight { margin-top:0.7rem; border:1.5px solid var(--tc-line); border-radius:12px; padding:0.85rem 0.9rem; background:var(--surface); direction:ltr; text-align:center; }
.tcc-tonight.is-leah, .tcc-tonight.is-rochel { background:var(--tc-fill); border-color:var(--tc-line); }
.tcc-tonight-src { font-size:max(12px,0.72rem); color:var(--ink2); line-height:1.5; margin-top:0.5rem; padding-top:0.45rem; border-top:1px solid var(--border); direction:ltr; text-align:center; }
.tcc-tonight-head { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
.tcc-tonight-main { font-size:0.95rem; font-weight:700; color:var(--ink); direction:ltr; line-height:1.45; }
.tcc-tonight.is-leah .tcc-tonight-main, .tcc-tonight.is-rochel .tcc-tonight-main { color:var(--tc); }
.tcc-tonight-main .tcc-amp { font-weight:400; color:var(--ink2); }
.tcc-tonight.is-leah .tcc-tonight-main .tcc-amp, .tcc-tonight.is-rochel .tcc-tonight-main .tcc-amp { color:var(--tc); opacity:0.7; }
.tcc-tonight-flag { font-size:max(12px,0.66rem); font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--ink2); background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:2px 8px; white-space:nowrap; }
.tcc-tonight-sub { font-size:0.8rem; color:var(--ink); line-height:1.55; margin-top:0.3rem; direction:ltr; text-align:center; }
.tcc-tonight-date { font-size:0.76rem; font-weight:700; color:var(--tc); margin-top:0.4rem; direction:ltr; text-align:center; }
/* The "right now" strip — what a person should be saying at this very moment */
.tcc-now { margin-top:0.7rem; border:1.5px solid var(--tc); border-radius:12px; padding:0.8rem 0.9rem; background:var(--tc-fill); direction:ltr; text-align:center; }
.tcc-now-label { font-size:max(12px,0.64rem); font-weight:700; letter-spacing:0.09em; text-transform:uppercase; color:var(--tc); direction:ltr; }
.tcc-now-main { font-size:0.95rem; font-weight:700; color:var(--ink); line-height:1.45; margin-top:0.25rem; direction:ltr; }
.tcc-now-say { font-size:1rem; font-weight:800; color:var(--tc); line-height:1.45; margin-top:0.45rem; direction:ltr; }
.tcc-now-sub { font-size:0.78rem; color:var(--ink2); line-height:1.55; margin-top:0.35rem; direction:ltr; }
.tcc-next-night { margin-top:0.55rem; border:1px dashed var(--tc-line); border-radius:10px; padding:0.6rem 0.75rem; background:var(--surface); direction:ltr; text-align:center; font-size:0.79rem; color:var(--ink2); line-height:1.6; }
.tcc-next-night strong { color:var(--ink); font-weight:700; }
.tcc-date-note { font-size:max(12px,0.72rem); color:var(--ink2); line-height:1.5; margin-top:5px; direction:ltr; text-align:left; }
.tcc-date-note.is-now { color:var(--tc); font-weight:600; }
.tcc-date-row { display:flex; align-items:center; gap:6px; direction:ltr; }
.tcc-date-row .tcc-date { flex:1; min-width:0; }
.tcc-step { flex:none; width:38px; height:38px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-family:inherit; font-size:1.15rem; font-weight:700; color:var(--tc); background:var(--tc-fill); border:1.5px solid var(--tc-line); border-radius:10px; padding:0; }
.tcc-step:hover { background:var(--tc-mid); border-color:var(--tc); }
.tcc-date-jump { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.tcc-jump { font-size:max(12px,0.72rem); padding:3px 10px; }
.tcc-rows { margin-top:0.85rem; border:1.5px solid var(--border); border-radius:12px; overflow:hidden; }
.tcc-row { display:flex; align-items:baseline; gap:0.6rem; padding:0.5rem 0.8rem; border-bottom:1px solid var(--border); direction:ltr; }
.tcc-row:last-child { border-bottom:none; }
.tcc-row.is-final { background:var(--tc-fill); }
.tcc-row-name { font-size:0.84rem; font-weight:600; color:var(--ink); flex:1; min-width:0; }
.tcc-row-name .tcc-sub { display:block; font-size:max(12px,0.72rem); font-weight:400; color:var(--ink2); }
.tcc-row-val { font-size:0.9rem; font-weight:700; color:var(--ink); direction:ltr; white-space:nowrap; font-variant-numeric:tabular-nums; }
.tcc-row.is-final .tcc-row-val { color:var(--tc); }
.tcc-next { font-size:max(12px,0.68rem); font-weight:600; color:var(--ink2); margin-left:0.35rem; white-space:nowrap; }
.tcc-label { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--tc); margin:1rem 0 0.5rem; direction:ltr; text-align:left; }
.tcc-presets { display:flex; flex-wrap:wrap; gap:6px; }
.tcc-preset { cursor:pointer; font-size:0.76rem; font-weight:600; color:var(--tc); background:var(--surface); border:1.5px solid var(--tc-line); border-radius:999px; padding:4px 11px; direction:ltr; font-family:inherit; }
.tcc-preset:hover { background:var(--tc-fill); }
.tcc-preset.active { background:var(--tc); border-color:var(--tc); color:var(--on-accent); }
.tcc-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.tcc-field { display:flex; flex-direction:column; gap:3px; direction:ltr; text-align:left; }
.tcc-field.wide { grid-column:1 / -1; }
.tcc-field label { font-size:max(12px,0.74rem); font-weight:600; color:var(--ink2); direction:ltr; text-align:left; }
.tcc-field input, .tcc-field select {
  font-family:inherit; font-size:0.86rem; color:var(--ink); background:var(--surface);
  border:1px solid var(--border); border-radius:10px; padding:7px 9px; width:100%;
  direction:ltr; text-align:left; -webkit-appearance:none; appearance:none;
}
.tcc-field input:focus, .tcc-field select:focus { outline:none; border-color:var(--tc); box-shadow:0 0 0 3px var(--tc-light); }
.tcc-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:0.8rem; }
.tcc-btn { display:inline-flex; align-items:center; gap:6px; cursor:pointer; font-family:inherit; font-size:0.8rem; font-weight:600; color:var(--on-accent); background:var(--tc); border:1px solid var(--tc); border-radius:10px; padding:7px 13px; direction:ltr; }
.tcc-btn:hover { filter:brightness(1.08); }
.tcc-btn[disabled] { opacity:0.65; cursor:default; filter:none; }
.tcc-btn.ghost { color:var(--tc); background:var(--tc-fill); border:1.5px solid var(--tc-line); }
.tcc-btn.ghost:hover { background:var(--tc-mid); filter:none; }
.tcc-adv-toggle { cursor:pointer; font-family:inherit; font-size:0.78rem; font-weight:600; color:var(--ink2); background:none; border:none; padding:0.75rem 0 0; direction:ltr; text-align:left; display:inline-flex; align-items:center; gap:5px; }
.tcc-adv-toggle:hover { color:var(--tc); }
.tcc-adv { display:none; margin-top:0.6rem; padding:0.85rem 0.9rem; background:var(--surface2); border:1.5px solid var(--border); border-radius:12px; }
.tcc-adv.open { display:block; }
.tcc-adv-note { font-size:0.75rem; color:var(--ink2); line-height:1.55; margin-bottom:0.7rem; direction:ltr; text-align:left; }
.tcc-adv-label { font-size:max(12px,0.68rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--tc); margin:0.85rem 0 0.45rem; direction:ltr; text-align:left; }
.tcc-adv-label:first-of-type { margin-top:0; }
.tcc-note { font-size:0.76rem; color:var(--ink2); line-height:1.6; margin-top:0.9rem; padding-top:0.6rem; border-top:1px solid var(--border); direction:ltr; text-align:left; }
/* Dark-mode legibility for the calculator's filled pills/buttons lives in the
   consolidated "SELECTED FILTER/TOGGLE LEGIBILITY" block at the end of the CSS. */
@media (max-width:520px){
  .tcc-hero-time { font-size:2.1rem; }
  .tcc-grid { grid-template-columns:1fr; }
}
.tc-intro { padding:2px 2px 4px; direction:ltr; text-align:left; }
.tc-intro-kicker { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--tc); margin-bottom:0.5rem; direction:ltr; text-align:left; }
.tc-intro-he { font-family:var(--font-ui); direction:rtl; text-align:right; font-size:1.9rem; font-weight:700; color:var(--tc); line-height:1.2; }
.tc-intro-en { font-size:0.9rem; font-weight:600; color:var(--ink2); margin:0.15rem 0 0.9rem; direction:ltr; text-align:left; }
.tc-intro-body { font-size:0.9rem; color:var(--ink); line-height:1.7; margin-bottom:0.8rem; direction:ltr; text-align:left; }
.tc-intro-quote { background:var(--tc-light); border-radius:12px; padding:0.85rem 1rem; margin:0.4rem 0 0.9rem; text-align:center; direction:ltr; }
.tc-intro-quote .q-he { font-family:var(--font-ui); direction:rtl; font-size:1.25rem; font-weight:700; color:var(--tc); display:block; line-height:1.7; }
.tc-intro-quote .q-en { font-size:0.82rem; color:var(--ink2); font-style:italic; display:block; margin-top:0.3rem; }
.tc-intro-note { font-size:0.8rem; color:var(--ink3); line-height:1.6; direction:ltr; text-align:left; }
.tc-sefaria-row { display:flex; flex-wrap:wrap; gap:8px; margin:0.3rem 0 0.2rem; }
.tc-sefaria-btn { display:inline-flex; align-items:center; gap:5px; font-size:0.8rem; font-weight:600; color:var(--tc); background:var(--tc-light); border:1px solid var(--tc-mid); border-radius:10px; padding:6px 11px; text-decoration:none; direction:ltr; }
.tc-sefaria-btn:hover { background:var(--tc-mid); }
/* ── Collapsible filter bar (Tikkun Chatzos, Simcha, True Tzaddik) ── */
.filter-collapse { border:1px solid var(--border); border-radius:12px; background:var(--surface2); overflow:hidden; margin:0 0 10px; }
.filter-collapse-bar { width:100%; display:flex; align-items:center; gap:8px; background:none; border:none; cursor:pointer; padding:9px 13px; font:inherit; color:var(--ink2); }
.filter-collapse-bar .fc-ico { width:15px; height:15px; flex:none; color:var(--ic-accent,var(--accent)); }
.filter-collapse-bar .fc-label { flex:1; text-align:left; font-size:0.78rem; font-weight:700; letter-spacing:0.04em; }
.filter-collapse-bar .fc-chev { color:var(--ink3); transition:transform .2s; font-size:0.9rem; }
.filter-collapse.open .fc-chev { transform:rotate(180deg); }
.filter-collapse-body { display:none; padding:2px 10px 10px; }
.filter-collapse.open .filter-collapse-body { display:block; }
.filter-collapse-body .lh-sec-row { flex-wrap:wrap; padding-top:0; }
#mnBackBtn{position:fixed;bottom:4.75rem;right:1.5rem;z-index:300;display:flex;align-items:center;gap:0.35rem;background:var(--surface);color:var(--mn);border:1.5px solid var(--mn-mid);border-radius:980px;padding:0.5rem 0.95rem;font-family:var(--font-ui);font-size:0.85rem;font-weight:700;cursor:pointer;box-shadow:var(--shadow-md);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s,transform .2s;}
#mnBackBtn.show{opacity:1;transform:none;pointer-events:auto;}
#mnBackBtn:hover{background:var(--mn);color:var(--on-accent);border-color:var(--mn);}

/* Intro hero panel */
.shtz-intro {
  position:relative; overflow:hidden;
  background:linear-gradient(155deg, var(--shtz) 0%, var(--shtz2) 100%);
  border-radius:var(--radius); padding:1.6rem 1.5rem 1.5rem;
  margin-bottom:1.1rem; box-shadow:var(--shadow-md);
}
.shtz-intro-kicker {
  font-size:max(12px,0.66rem); font-weight:800; letter-spacing:0.14em; text-transform:uppercase;
  color:rgba(255,255,255,0.85); margin-bottom:0.35rem;
}
.shtz-intro-he { font-size:1.5rem; font-weight:800; color:#fff; line-height:1.2; }
.shtz-intro-en { font-size:0.92rem; font-weight:600; color:rgba(255,255,255,0.92); direction:ltr; margin-top:0.15rem; }
.shtz-intro-body {
  position:relative; z-index:1; margin-top:0.9rem; font-size:0.93rem; line-height:1.72;
  color:rgba(255,255,255,0.97); direction:ltr; max-width:64ch;
}
.shtz-intro-body strong { color:#fff; font-weight:700; }
.shtz-intro-quote {
  position:relative; z-index:1; margin:0.95rem 0; padding:0.7rem 1rem;
  border-left:4px solid rgba(255,255,255,0.6); background:rgba(255,255,255,0.12);
  border-radius:0 10px 10px 0; direction:ltr; max-width:64ch;
}
.shtz-intro-quote .q-text { font-size:0.96rem; line-height:1.65; color:#fff; font-style:italic; font-weight:600; }
.shtz-intro-quote .q-attr { display:block; margin-top:0.4rem; font-size:0.78rem; color:rgba(255,255,255,0.88); font-style:normal; font-weight:600; }
.shtz-intro-source {
  position:relative; z-index:1; margin-top:0.85rem; font-size:max(12px,0.72rem); font-style:italic;
  color:rgba(255,255,255,0.82); direction:ltr;
}
.shtz-list-label {
  font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--shtz);
  text-transform:uppercase; padding:0.4rem 0.2rem 0.6rem; direction:ltr;
}

/* Tzaddik cards */
.shtz-entry {
  background:var(--surface); border-radius:var(--radius); margin-bottom:0.7rem;
  overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border);
  transition:box-shadow 0.2s, transform 0.15s;
}
.shtz-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.shtz-entry-header {
  display:flex; align-items:center; gap:0.75rem;
  padding:0.85rem 1.2rem; cursor:pointer; user-select:none; transition:background 0.12s;
}
.shtz-entry-header:hover { background:var(--shtz-light); }
.shtz-entry:not(.open) .shtz-entry-body { display:none; }
.shtz-entry.open .shtz-entry-header { border-bottom:1px solid var(--border); }
.shtz-entry.open .shtz-arrow { transform:rotate(180deg); background:var(--shtz); color:var(--on-accent); border-color:var(--shtz); }
.shtz-index {
  width:1.7rem; height:1.7rem; flex-shrink:0; border-radius:50%;
  background:var(--shtz-light); color:var(--shtz); font-size:max(12px,0.74rem); font-weight:700;
  display:flex; align-items:center; justify-content:center; border:1.5px solid var(--shtz-mid);
}
.shtz-head-main { display:flex; flex-direction:column; gap:0.18rem; flex:1; min-width:0; }
.shtz-name { font-size:1.05rem; font-weight:700; color:var(--ink); direction:ltr; }
.shtz-meta { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; direction:ltr; }
.shtz-dates { font-size:0.8rem; font-weight:500; color:var(--ink2); }
.shtz-badge {
  font-size:max(12px,0.66rem); font-weight:700; letter-spacing:0.02em; padding:0.12rem 0.55rem;
  border-radius:980px; background:var(--shtz-light); color:var(--shtz);
  border:1px solid var(--shtz-mid); white-space:nowrap;
}
.shtz-badge.g-chassidic { background:rgba(169,121,27,0.10); color:var(--shtz); border-color:var(--shtz-mid); }
.shtz-badge.g-litvish { background:rgba(31,111,168,0.12); color:#1f6fa8; border-color:rgba(31,111,168,0.3); }
.shtz-badge.g-sephardi { background:rgba(160,60,90,0.12); color:#a03c5a; border-color:rgba(160,60,90,0.3); }
html[data-dark] .shtz-badge.g-litvish { color:#6cb6ee; border-color:rgba(108,182,238,0.35); background:rgba(108,182,238,0.16); }
html[data-dark] .shtz-badge.g-sephardi { color:#e58aa6; border-color:rgba(229,138,166,0.35); background:rgba(229,138,166,0.16); }
.shtz-arrow {
  margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center;
  justify-content:center; border-radius:50%; background:var(--shtz-light);
  border:1.5px solid var(--shtz-mid); color:var(--shtz); font-size:1rem; flex-shrink:0;
  transition:transform 0.2s, background 0.15s;
}
.shtz-entry-body { padding:0.2rem 1.2rem 1rem; }
.shtz-role { font-size:0.82rem; font-style:italic; color:var(--ink2); direction:ltr; padding-top:0.7rem; line-height:1.5; }
.shtz-story { font-size:0.93rem; line-height:1.78; color:var(--ink); direction:ltr; margin-top:0.5rem; }
.shtz-quote {
  margin:0.7rem 0 0; padding:0.6rem 0.9rem; border-right:3px solid var(--shtz-mid);
  background:var(--shtz-light); border-radius:10px 0 0 10px;
}
.shtz-quote-heb {
  direction:rtl; unicode-bidi:isolate; text-align:right;
  font-size:1.02rem; line-height:1.7; color:var(--ink); font-weight:600;
}
.shtz-quote-label {
  margin-top:0.5rem; font-size:max(12px,0.58rem); font-weight:700; letter-spacing:0.08em;
  text-transform:uppercase; color:var(--shtz); direction:ltr; text-align:left;
}
.shtz-quote-en {
  margin-top:0.12rem; direction:ltr; text-align:left;
  font-size:0.86rem; line-height:1.6; color:var(--ink2); font-style:italic;
}
.shtz-src-label {
  font-size:max(12px,0.63rem); font-weight:700; letter-spacing:0.08em; color:var(--shtz);
  text-transform:uppercase; margin-top:0.9rem; margin-bottom:0.4rem; direction:ltr;
}
.shtz-src { font-size:0.78rem; line-height:1.6; color:var(--ink2); direction:ltr; }
.shtz-src a { color:var(--shtz); text-decoration:none; border-bottom:1px solid var(--shtz-mid); }
.shtz-src a:hover { color:var(--shtz2); }
@media (max-width:600px) {
  .shtz-intro { padding:1.3rem 1.1rem; }
  .shtz-intro-he { font-size:1.25rem; }
  .shtz-intro-body { font-size:0.88rem; }
  .shtz-entry-header { padding:0.75rem 0.85rem; }
  .shtz-entry-body { padding:0.2rem 0.85rem 0.85rem; }
  .shtz-name { font-size:0.98rem; }
}

/* ── CHAYEI NEFESH (CN) · Tefilah, Nevuah & the Role of the Tzaddik ─────────── */
.cn-intro-lead {
  font-size:0.9rem; line-height:1.7; color:var(--ink2); direction:ltr;
  margin:0.2rem 0 1rem; text-align:left;
}
.cn-intro-lead strong { color:var(--cn); font-weight:700; }
.cn-view-row { display:flex; gap:0.45rem; flex-wrap:wrap; margin-bottom:1rem; justify-content:safe center; }
.cn-view-btn {
  font-family:inherit; font-size:0.82rem; font-weight:600; padding:0.4rem 1rem;
  border:1.5px solid var(--cn-mid); border-radius:980px; background:var(--surface);
  color:var(--cn); cursor:pointer; transition:all 0.15s; white-space:nowrap;
}
.cn-view-btn.active { background:var(--cn); color:var(--on-accent); border-color:var(--cn); box-shadow:0 2px 8px rgba(194,65,12,0.3); }
.cn-view-btn:not(.active):hover { background:var(--cn-light); }
.cn-list-label {
  font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--cn);
  text-transform:uppercase; padding:0.2rem 0.2rem 0.6rem; direction:ltr;
}
.cn-entry {
  background:var(--surface); border-radius:var(--radius); margin-bottom:0.7rem;
  overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border);
  transition:box-shadow 0.2s, transform 0.15s;
}
.cn-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.cn-entry-header {
  display:flex; align-items:center; gap:0.75rem;
  padding:0.85rem 1.2rem; cursor:pointer; user-select:none; transition:background 0.12s;
}
.cn-entry-header:hover { background:var(--cn-light); }
.cn-entry:not(.open) .cn-entry-body { display:none; }
.cn-entry.open .cn-entry-header { border-bottom:1px solid var(--border); }
.cn-entry.open .cn-arrow { transform:rotate(180deg); background:var(--cn); color:var(--on-accent); border-color:var(--cn); }
.cn-index {
  width:1.7rem; height:1.7rem; flex-shrink:0; border-radius:50%;
  background:var(--cn-light); color:var(--cn); font-size:max(12px,0.74rem); font-weight:700;
  display:flex; align-items:center; justify-content:center; border:1.5px solid var(--cn-mid);
}
.cn-head-main { display:flex; flex-direction:column; gap:0.2rem; flex:1; min-width:0; }
.cn-name { font-size:0.98rem; font-weight:700; color:var(--ink); direction:ltr; line-height:1.35; }
.cn-badge {
  font-size:max(12px,0.6rem); font-weight:700; letter-spacing:0.03em; padding:0.1rem 0.5rem;
  border-radius:980px; background:var(--cn-light); color:var(--cn);
  border:1px solid var(--cn-mid); white-space:nowrap; align-self:flex-start;
}
.cn-arrow {
  margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center;
  justify-content:center; border-radius:50%; background:var(--cn-light);
  border:1.5px solid var(--cn-mid); color:var(--cn); font-size:1rem; flex-shrink:0;
  transition:transform 0.2s, background 0.15s;
}
.cn-entry-body { padding:0.2rem 1.2rem 1rem; }
.cn-he-quote {
  direction:rtl; unicode-bidi:isolate; text-align:right;
  font-size:1.02rem; line-height:1.7; color:var(--cn); font-weight:600;
  padding-top:0.7rem;
}
.cn-body-text { font-size:0.93rem; line-height:1.8; color:var(--ink); direction:ltr; margin-top:0.55rem; }
.cn-src-label {
  font-size:max(12px,0.63rem); font-weight:700; letter-spacing:0.08em; color:var(--cn);
  text-transform:uppercase; margin-top:0.9rem; margin-bottom:0.35rem; direction:ltr;
}
.cn-src { font-size:0.78rem; line-height:1.6; color:var(--ink2); direction:ltr; }
.cn-rel { display:flex; flex-wrap:wrap; gap:0.4rem; direction:ltr; }
.cn-rel-link {
  font-family:inherit; font-size:max(12px,0.72rem); font-weight:600; line-height:1.3;
  padding:0.28rem 0.7rem; border-radius:980px; cursor:pointer; text-align:left;
  background:var(--cn-light); color:var(--cn); border:1px solid var(--cn-mid);
  transition:background 0.15s, transform 0.12s;
}
.cn-rel-link:hover { background:var(--cn-mid); }
.cn-rel-link:active { transform:scale(0.97); }
.cn-about-box {
  background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px 20px;
}
.cn-about-he { font-size:1.1rem; font-weight:700; color:var(--cn); margin-bottom:2px; direction:rtl; }
.cn-about-en { font-size:0.85rem; font-weight:600; color:var(--ink2); margin-bottom:8px; direction:ltr; }
.cn-about-text { font-size:0.83rem; color:var(--ink2); line-height:1.7; direction:ltr; }
.cn-about-text strong { color:var(--ink); }
.cn-about-sub { font-size:max(12px,0.66rem); font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--cn); margin:0.9rem 0 0.3rem; direction:ltr; }
@media (max-width:600px) {
  .cn-entry-header { padding:0.75rem 0.85rem; }
  .cn-entry-body { padding:0.2rem 0.85rem 0.85rem; }
  .cn-name { font-size:0.92rem; }
}

/* ── CHAMESHES YECHIDEI HADOROS (YH) · THE FIVE UNIQUE SOULS ───────────────── */
.yh-toggle-btn.active { background:var(--yh) !important; color:var(--on-accent) !important; box-shadow:0 2px 8px rgba(4,120,87,0.35) !important; }
.yh-toggle-btn:not(.active):hover { background:var(--yh-light) !important; color:var(--yh) !important; }
/* Sub-nav inside The True Tzaddik: colour the "Five Unique Souls" button emerald */
.tt-subnav .yh-view-btn.active { background:var(--yh); border-color:var(--yh); color:var(--on-accent); box-shadow:0 2px 8px rgba(4,120,87,0.3); }
.tt-subnav .yh-view-btn:not(.active) { color:var(--yh); }
.tt-subnav .yh-view-btn:not(.active):hover { background:var(--yh-light); }
.tt-subnav .mb-view-btn.active { background:var(--mb); border-color:var(--mb); color:var(--on-accent); box-shadow:0 2px 8px rgba(63,107,140,0.3); }
.tt-subnav .mb-view-btn:not(.active) { color:var(--mb); }
.tt-subnav .mb-view-btn:not(.active):hover { background:var(--mb-light); }
.yh-intro-lead {
  font-size:0.9rem; line-height:1.7; color:var(--ink2); direction:ltr;
  padding:0.2rem 0.3rem 0.9rem;
}
.yh-list-label {
  font-size:max(12px,0.65rem); font-weight:700; letter-spacing:0.08em; color:var(--yh);
  text-transform:uppercase; padding:0.7rem 0.2rem 0.6rem; direction:ltr;
}
.yh-entry {
  background:var(--surface); border-radius:var(--radius); margin-bottom:0.7rem;
  overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border);
  transition:box-shadow 0.2s, transform 0.15s;
}
.yh-entry:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.yh-entry-header {
  display:flex; align-items:center; gap:0.75rem;
  padding:0.85rem 1.2rem; cursor:pointer; user-select:none; transition:background 0.12s;
}
.yh-entry-header:hover { background:var(--yh-light); }
.yh-entry:not(.open) .yh-entry-body { display:none; }
.yh-entry.open .yh-entry-header { border-bottom:1px solid var(--border); }
.yh-entry.open .yh-arrow { transform:rotate(180deg); background:var(--yh); color:var(--on-accent); border-color:var(--yh); }
.yh-index {
  width:1.7rem; height:1.7rem; flex-shrink:0; border-radius:50%;
  background:var(--yh-light); color:var(--yh); font-size:max(12px,0.74rem); font-weight:700;
  display:flex; align-items:center; justify-content:center; border:1.5px solid var(--yh-mid);
}
.yh-head-main { display:flex; flex-direction:column; gap:0.2rem; flex:1; min-width:0; }
.yh-name { font-size:0.98rem; font-weight:700; color:var(--ink); direction:ltr; line-height:1.35; }
.yh-badge {
  font-size:max(12px,0.6rem); font-weight:700; letter-spacing:0.03em; padding:0.1rem 0.5rem;
  border-radius:980px; background:var(--yh-light); color:var(--yh);
  border:1px solid var(--yh-mid); white-space:nowrap; align-self:flex-start;
}
.yh-arrow {
  margin-left:auto; width:1.8rem; height:1.8rem; display:flex; align-items:center;
  justify-content:center; border-radius:50%; background:var(--yh-light);
  border:1.5px solid var(--yh-mid); color:var(--yh); font-size:1rem; flex-shrink:0;
  transition:transform 0.2s, background 0.15s;
}
.yh-entry-body { padding:0.2rem 1.2rem 1rem; }
.yh-he-quote {
  direction:rtl; unicode-bidi:isolate; text-align:right;
  font-size:1.02rem; line-height:1.9; color:var(--yh); font-weight:600;
  padding-top:0.7rem;
}
.yh-body-text { font-size:0.93rem; line-height:1.8; color:var(--ink); direction:ltr; margin-top:0.55rem; text-align:left; }
.yh-src-label {
  font-size:max(12px,0.63rem); font-weight:700; letter-spacing:0.08em; color:var(--yh);
  text-transform:uppercase; margin-top:0.9rem; margin-bottom:0.35rem; direction:ltr;
}
.yh-src { font-size:0.78rem; line-height:1.6; color:var(--ink2); direction:ltr; text-align:left; }
.yh-links { display:flex; flex-wrap:wrap; gap:0.4rem; direction:ltr; margin-top:0.15rem; }
.yh-ext-link {
  display:inline-flex; align-items:center; gap:4px; padding:0.28rem 0.7rem;
  border-radius:980px; font-size:max(12px,0.72rem); font-weight:600; line-height:1.2;
  background:var(--yh-light); color:var(--yh); border:1px solid var(--yh-mid);
  text-decoration:none; white-space:nowrap; transition:background 0.15s, transform 0.12s;
}
.yh-ext-link:hover { background:var(--yh-mid); }
.yh-ext-link:active { transform:scale(0.97); }
.yh-rel { display:flex; flex-wrap:wrap; gap:0.4rem; direction:ltr; }
.yh-rel-link {
  font-family:inherit; font-size:max(12px,0.72rem); font-weight:600; line-height:1.3;
  padding:0.28rem 0.7rem; border-radius:980px; cursor:pointer; text-align:left;
  background:var(--yh-light); color:var(--yh); border:1px solid var(--yh-mid);
  transition:background 0.15s, transform 0.12s;
}
.yh-rel-link:hover { background:var(--yh-mid); }
.yh-rel-link:active { transform:scale(0.97); }
.yh-gematria {
  margin-top:0.6rem; border:1px solid var(--yh-mid); border-radius:12px;
  background:var(--yh-light); padding:0.7rem 0.9rem; direction:rtl;
}
.yh-gematria-row {
  display:flex; align-items:center; justify-content:space-between; gap:0.6rem;
  font-size:0.95rem; color:var(--ink); font-weight:600; padding:0.2rem 0;
}
.yh-gematria-row .yh-gem-val { color:var(--yh); font-weight:700; direction:ltr; }
.yh-about-box {
  background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:14px 20px;
}
.yh-about-he { font-size:1.1rem; font-weight:700; color:var(--yh); margin-bottom:2px; direction:rtl; }
.yh-about-en { font-size:0.85rem; font-weight:600; color:var(--ink2); margin-bottom:8px; direction:ltr; }
.yh-about-text { font-size:0.83rem; color:var(--ink2); line-height:1.7; direction:ltr; text-align:left; }
.yh-about-text strong { color:var(--ink); }
.yh-about-sub { font-size:max(12px,0.66rem); font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--yh); margin:0.9rem 0 0.3rem; direction:ltr; }
.yh-note {
  background:var(--yh-light); border:1px solid var(--yh-mid); border-radius:14px;
  padding:0.9rem 1.2rem; margin-bottom:0.7rem;
}
.yh-note-title { font-size:max(12px,0.7rem); font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--yh); margin-bottom:0.4rem; direction:ltr; }
.yh-note-text { font-size:0.86rem; line-height:1.75; color:var(--ink2); direction:ltr; text-align:left; }
.yh-note-text strong { color:var(--ink); }
@media (max-width:600px) {
  .yh-entry-header { padding:0.75rem 0.85rem; }
  .yh-entry-body { padding:0.2rem 0.85rem 0.85rem; }
  .yh-name { font-size:0.92rem; }
}
/* Mevakesh B'Tzion cards reuse the yh-* card styling but recolor to the
   section's own slate accent by overriding the yh accent vars in scope. */
.mb-scope { --yh:var(--mb); --yh2:var(--mb2); --yh-light:var(--mb-light); --yh-mid:var(--mb-mid); }

/* ── THE GENERATIONAL CHAIN (gc) + THE LIBRARY (lib) ──────────────────────── */
.gc-entry .entry-book { background:var(--gc-light); color:var(--gc); border-color:var(--gc-mid); }
.lib-entry .entry-book { background:var(--lib-light); color:var(--lib); border-color:var(--lib-mid); }
/* The results area is RTL by default (Hebrew-first site), so every English-
   bearing container must opt back into LTR — otherwise the text right-justifies
   and trailing punctuation (full stops, closing quotes) bidi-reorders to the
   wrong end of the line. Set it once on the card bodies + intro wrappers here;
   Hebrew children below override back to RTL with unicode-bidi:isolate. */
.gc-body, .lib-body { display:none; padding:0 1.2rem 1.1rem; direction:ltr; text-align:left; }
.entry.gc-entry.open .gc-body, .entry.lib-entry.open .lib-body { display:block; }
.gc-entry .entry-title, .lib-entry .entry-title { direction:ltr; text-align:left; }
.gc-dates { font-weight:500; color:var(--muted); font-size:0.88em; white-space:nowrap; direction:ltr; unicode-bidi:isolate; }
.gc-role {
  font-size:0.82rem; font-weight:600; color:var(--gc);
  margin:0 0 0.7rem; padding-bottom:0.55rem;
  border-bottom:1px solid var(--border);
  text-align:left;
}
.gc-en, .lib-en {
  font-size:0.95rem; line-height:1.75; color:var(--ink);
  text-align:left; direction:ltr;
}
.lib-yr {
  font-size:0.78rem; font-weight:600; color:var(--lib);
  margin:0 0 0.6rem; padding-bottom:0.5rem;
  border-bottom:1px solid var(--border);
  text-align:left;
}
.gc-source, .lib-source {
  margin-top:0.9rem; padding-top:0.6rem;
  border-top:1px solid var(--border);
  font-size:max(12px,0.74rem); color:var(--muted); text-align:left;
}
.gc-seforim { margin-top:1rem; padding-top:0.8rem; border-top:1px solid var(--border); }
.gc-seforim-label {
  font-size:max(12px,0.68rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--muted); margin-bottom:0.5rem; text-align:left;
}
.gc-sef-chips { display:flex; flex-wrap:wrap; gap:0.4rem; justify-content:flex-start; direction:ltr; }
.gc-sef-chip, .lib-author-link, .lib-open-btn {
  font-family:inherit; cursor:pointer;
  font-size:0.78rem; font-weight:600;
  padding:0.34rem 0.7rem; border-radius:999px;
  transition:background 0.15s, border-color 0.15s;
  text-align:left;
}
.gc-sef-chip {
  background:var(--gc-light); color:var(--gc); border:1px solid var(--gc-mid);
}
.gc-sef-chip:hover { background:var(--gc-mid); border-color:var(--gc); }
.lib-actions { display:flex; flex-wrap:wrap; gap:0.4rem; margin-top:0.9rem; justify-content:flex-start; direction:ltr; }
.lib-author-link {
  background:var(--gc-light); color:var(--gc); border:1px solid var(--gc-mid);
}
.lib-author-link:hover { background:var(--gc-mid); border-color:var(--gc); }
.lib-author-plain {
  font-size:0.78rem; font-weight:600; color:var(--muted);
  padding:0.34rem 0.7rem; text-align:left;
}
.lib-open-btn {
  background:var(--lib-light); color:var(--lib); border:1px solid var(--lib-mid);
}
.lib-open-btn:hover { background:var(--lib-mid); border-color:var(--lib); }
.lib-entry .entry-title { display:flex; flex-wrap:wrap; align-items:baseline; gap:0.15rem 0.5rem; }
.lib-he-t { font-family:var(--font-ui); font-weight:700; direction:rtl; unicode-bidi:isolate; }
.lib-en-t { font-weight:600; color:var(--muted); font-size:0.92em; direction:ltr; unicode-bidi:isolate; }
.lib-entry .lib-en-t:only-child { color:var(--ink); font-size:1em; font-weight:700; }
/* Intro cards — LTR base (see the bidi note above); Hebrew children opt back to RTL. */
.gc-intro, .lib-intro-c { direction:ltr; text-align:left; }
.gc-intro-kicker, .lib-intro-kicker {
  font-size:max(12px,0.68rem); font-weight:700; letter-spacing:0.09em; text-transform:uppercase;
  color:var(--muted); margin-bottom:0.6rem; direction:ltr; text-align:left;
}
.gc-intro-he, .lib-intro-he {
  font-family:var(--font-ui);
  font-size:1.6rem; font-weight:700; margin-bottom:0.1rem;
  direction:rtl; unicode-bidi:isolate; text-align:right;
}
.gc-intro-he { color:var(--gc); }
.lib-intro-he { color:var(--lib); }
.gc-intro-en, .lib-intro-en {
  font-size:0.9rem; font-weight:600; color:var(--muted); margin-bottom:0.9rem;
  direction:ltr; text-align:left;
}
.gc-intro-body, .lib-intro-body {
  font-size:0.95rem; line-height:1.75; color:var(--ink); margin-bottom:0.9rem;
  direction:ltr; text-align:left;
}
/* The container MUST be direction:ltr. Without it the English line inherits an
   RTL context from the Hebrew span beside it, which right-justifies the sentence
   AND bidi-reorders the trailing full stop out of the closing quote mark.
   unicode-bidi:isolate keeps each line's direction to itself. */
.gc-intro-quote {
  margin:1rem 0; padding:0.8rem 1rem; border-radius:10px;
  background:var(--gc-light); border-left:3px solid var(--gc);
  display:flex; flex-direction:column; gap:0.35rem;
  direction:ltr; text-align:left;
}
.gc-intro-quote .q-he {
  font-family:var(--font-ui);
  font-size:1.15rem; font-weight:700; color:var(--gc); line-height:1.7;
  display:block; direction:rtl; unicode-bidi:isolate; text-align:right;
}
.gc-intro-quote .q-en {
  font-size:0.86rem; color:var(--ink2); font-style:italic; line-height:1.6;
  display:block; direction:ltr; unicode-bidi:isolate; text-align:left;
}
.gc-intro-note, .lib-intro-note {
  font-size:0.8rem; line-height:1.6; color:var(--muted);
  padding-top:0.7rem; border-top:1px solid var(--border);
  direction:ltr; text-align:left;
}
@media (max-width:520px){
  .gc-en, .lib-en, .gc-intro-body, .lib-intro-body { font-size:0.92rem; }
  .gc-sef-chip, .lib-author-link, .lib-open-btn { font-size:max(12px,0.74rem); }
}

/* ── SELECTED FILTER/TOGGLE LEGIBILITY (site-wide) ────────────────────────────
   Section accents (cn, yh, mb, his, shtz, kab, mn, sim, tc, shm) are lightened
   in dark mode, so the default white label on a filled "active" pill becomes
   unreadable once selected. Force a dark label on every active/selected pill
   that fills with a light section accent: in dark mode for all of them, and in
   BOTH modes for the gold favourites accent (--fav), which is light even in
   light mode. The main purple --accent stays dark in both modes, so its pills
   keep white text and are intentionally excluded. Recurring bug — see CLAUDE.md. */
.fav-nav-btn.active, #mobileFavBtn.active { color:var(--on-accent); }
.fav-toggle-btn.active { color:var(--on-accent) !important; }
html[data-dark] .his-toggle-btn.active,
html[data-dark] .his-view-btn.active,
html[data-dark] .shtz-toggle-btn.active,
html[data-dark] .kab-toggle-btn.active,
html[data-dark] .kab-pill.active,
html[data-dark] .mn-toggle-btn.active,
html[data-dark] .cn-toggle-btn.active,
html[data-dark] .cn-view-btn.active,
html[data-dark] .sim-toggle-btn.active,
html[data-dark] .pw-toggle-btn.active,
html[data-dark] #pwFilters .sec-btn.active,
html[data-dark] .tc-toggle-btn.active,
html[data-dark] .ym-toggle-btn.active,
html[data-dark] .gc-toggle-btn.active,
html[data-dark] .lib-toggle-btn.active,
html[data-dark] .yh-toggle-btn.active,
html[data-dark] .tt-subnav .yh-view-btn.active,
html[data-dark] .tt-subnav .mb-view-btn.active,
html[data-dark] .sec-btn-shm.active,
html[data-dark] .sec-btn-shm:hover,
html[data-dark] .tcc-preset.active,
html[data-dark] .tcc-btn:not(.ghost),
html[data-dark] .fav-nav-btn.active,
html[data-dark] #mobileFavBtn.active,
html[data-dark] .fav-toggle-btn.active {
  color:var(--on-accent) !important;
}
/* .tcc-btn.ghost keeps its --tc label on the pale --tc-light fill in both modes
   — it is NOT filled with the accent, so it must stay out of the rule above. */
/* Bare .sec-btn filter chips (no colour-modifier class) get only `color:#fff`
   on .active with NO background, so the selected chip is white-on-white and
   invisible. This affects the filter rows that use plain .sec-btn: The True
   Tzaddik (cn-part), Simcha (sim-sef) and Tikkun Chatzos (tc-theme). Give each
   a proper filled active state in its own section accent, with a readable label
   in both modes (white on the dark light-mode accent; dark on the lightened
   dark-mode accent). */
#cnFilters .sec-btn.active { background:var(--cn); border-color:var(--cn); color:var(--on-accent); }
#gcFilters .sec-btn.active { background:var(--gc); border-color:var(--gc); color:var(--on-accent); }
#libFilters .sec-btn.active { background:var(--lib); border-color:var(--lib); color:var(--on-accent); }
html[data-dark] #gcFilters .sec-btn.active,
html[data-dark] #libFilters .sec-btn.active { color:var(--on-accent); }
#tcFilters .sec-btn.active { background:var(--tc); border-color:var(--tc); color:var(--on-accent); }
/* Simcha's gold accent is light in both modes, so its label is dark either way. */
#simFilters .sec-btn.active { background:var(--sim); border-color:var(--sim); color:var(--on-accent); }
#pwFilters .sec-btn.active { background:var(--pw); border-color:var(--pw); color:var(--on-accent); }
#ymFilters .sec-btn.active { background:var(--ym); border-color:var(--ym); color:var(--on-accent); }
html[data-dark] #cnFilters .sec-btn.active,
html[data-dark] #ymFilters .sec-btn.active,
html[data-dark] #tcFilters .sec-btn.active { color:var(--on-accent); }

/* ── STREAM OF CONSCIOUSNESS (SOC) ───────────────────────────────────────── */
.soc-section-wrap {
  border-top: 1px solid var(--soc-border);
}
.soc-header {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  cursor: pointer; user-select: none;
  background: var(--soc-light);
  transition: background 0.15s;
}
.soc-header:hover { background: var(--soc-mid); }
.soc-header-icon {
  font-size: 1rem; line-height: 1; flex-shrink: 0;
}
.soc-header-text {
  flex: 1; min-width: 0;
}
.soc-header-title {
  font-size: max(12px,0.72rem); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--soc);
}
.soc-header-sub {
  font-size: max(12px,0.65rem); color: var(--soc2); font-weight: 500; margin-top: 0.05rem;
}
.soc-toggle-arr {
  width: 1.5rem; height: 1.5rem; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; flex-shrink: 0;
  background: rgba(124,82,0,0.12); border: 1.5px solid var(--soc-border);
  color: var(--soc); font-size: 0.8rem;
  transition: transform 0.25s, background 0.15s, color 0.15s;
}
.soc-header.open .soc-toggle-arr {
  transform: rotate(180deg);
  background: var(--soc); color: var(--on-accent); border-color: var(--soc);
}
.soc-body {
  display: none;
  border-top: 1px solid var(--soc-border);
}
.soc-body.open { display: block; }
.soc-field {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--soc-border);
}
.soc-field:last-child { border-bottom: none; }
.soc-field-label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: max(12px,0.6rem); font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--soc);
  margin-bottom: 0.45rem;
  background: var(--soc-light); border: 1px solid var(--soc-border);
  border-radius: 980px; padding: 0.15rem 0.65rem;
}
.soc-field-text {
  font-size: 0.875rem; line-height: 1.65; color: var(--ink);
  direction: ltr; text-align: left;
}
.soc-bullets {
  list-style: none; padding: 0; margin: 0;
}
.soc-bullets li {
  font-size: 0.875rem; line-height: 1.65; color: var(--ink);
  padding: 0.18rem 0 0.18rem 1.1rem; position: relative;
  direction: ltr; text-align: left;
}
.soc-bullets li::before {
  content: '◆'; position: absolute; left: 0;
  color: var(--soc2); font-size: max(12px,0.45rem); top: 0.55rem;
}
.soc-snapshot-block {
  background: linear-gradient(135deg, rgba(124,82,0,0.06) 0%, rgba(124,82,0,0.03) 100%);
  border-radius: 10px; padding: 0.75rem 1rem;
  border: 1px solid var(--soc-border);
  font-size: 0.9rem; line-height: 1.6; color: var(--ink);
  font-style: italic; direction: ltr; text-align: left;
  margin-bottom: 0;
}
html[data-dark] .soc-snapshot-block {
  background: linear-gradient(135deg, rgba(124,82,0,0.15) 0%, rgba(124,82,0,0.08) 100%);
}
html[data-dark] .soc-section-wrap { border-top-color: rgba(124,82,0,0.2); }
html[data-dark] .soc-header { background: rgba(124,82,0,0.12); }
html[data-dark] .soc-header:hover { background: rgba(124,82,0,0.2); }
html[data-dark] .soc-body { border-top-color: rgba(124,82,0,0.2); }
html[data-dark] .soc-field { border-bottom-color: rgba(124,82,0,0.12); }
html[data-dark] .soc-field-label { color: #d4a000; border-color: rgba(212,160,0,0.25); background: rgba(212,160,0,0.1); }
html[data-dark] .soc-header-title { color: #d4a000; }
html[data-dark] .soc-header-sub { color: #a07800; }
html[data-dark] .soc-toggle-arr { color: #d4a000; border-color: rgba(212,160,0,0.3); background: rgba(212,160,0,0.1); }
html[data-dark] .soc-header.open .soc-toggle-arr { background: #d4a000; color: var(--on-accent); border-color: #d4a000; }
html[data-dark] .soc-bullets li::before { color: #a07800; }
@media (max-width:600px) {
  .soc-header { padding: 0.65rem 0.9rem; }
  .soc-field { padding: 0.65rem 0.9rem; }
  .soc-field-text, .soc-bullets li { font-size: 0.84rem; }
  .soc-snapshot-block { font-size: 0.84rem; }
}
/* ── Sefaria external link button ── */
/* Reading enhancements: text-size (zoom content only), inspire, resume */
#resultsArea, #aboutPanel { zoom: var(--read-zoom, 1); }
.fs-ctrl { display:inline-flex; align-items:center; gap:3px; }
.fs-btn {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:30px; height:30px; padding:0 6px;
  border-radius:9px; border:1px solid var(--border);
  background:var(--surface); color:var(--ink2);
  font-family:inherit; font-weight:700; cursor:pointer; line-height:1;
  transition:background .15s,color .15s;
}
.fs-btn:hover { background:var(--surface3); color:var(--ink); }
.fs-btn .fs-lg { font-size:1.05rem; }
.fs-btn .fs-sm { font-size:0.78rem; }
.inspire-btn {
  display:inline-flex; align-items:center; gap:6px;
  font-family:inherit; font-size:0.82rem; font-weight:600;
  color:var(--accent); background:var(--accent-light);
  border:1px solid var(--accent-mid); border-radius:980px;
  padding:5px 13px; cursor:pointer; transition:background .15s; white-space:nowrap;
}
.inspire-btn:hover { background:var(--accent-mid); }
.inspire-btn svg { width:14px; height:14px; flex-shrink:0; }
.search-scope-row { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
/* The page is dir="rtl", so without an explicit LTR the chip laid itself out
   right-to-left: the refresh icon sat on the far right and the card title was
   clipped from its START ("…ridge · Sipurei Maasiyos"). Force LTR so it reads
   icon → Resume → title → ✕, and let the title wrap instead of being cut off. */
.resume-chip {
  display:flex; align-items:center; gap:8px; padding:7px 12px;
  margin:0 auto 0.6rem; max-width:480px; width:calc(100% - 3rem);
  direction:ltr; text-align:left;
  background:var(--surface); border:1px solid var(--border); border-radius:12px; font-size:0.82rem;
}
.resume-chip .resume-ic { color:var(--accent); flex-shrink:0; display:inline-flex; }
.resume-chip .resume-go { flex:1; min-width:0; text-align:left; background:none; border:none; font-family:inherit; font-size:0.82rem; cursor:pointer; display:flex; align-items:baseline; gap:7px; padding:0; direction:ltr; }
.resume-chip .resume-lead { color:var(--ink2); font-weight:600; flex-shrink:0; }
.resume-chip .resume-chip-title { color:var(--accent); font-weight:600; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.resume-chip .resume-x { flex-shrink:0; background:none; border:none; color:var(--ink3); font-size:1rem; cursor:pointer; padding:2px 4px; line-height:1; }
@media (max-width:640px){
  /* On a phone the title has nowhere to go — let it run to two lines rather
     than being truncated, and top-align the icon and ✕ against it. */
  .resume-chip { align-items:flex-start; }
  .resume-chip .resume-ic { margin-top:2px; }
  .resume-chip .resume-go { align-items:flex-start; }
  .resume-chip .resume-lead { line-height:1.35; }
  .resume-chip .resume-chip-title {
    white-space:normal; overflow:hidden; text-overflow:clip; line-height:1.35;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  }
}
@media (max-width: 640px){
  .fav-section-btn span, .share-section-btn span { display:none; }
  .fav-section-btn, .share-section-btn { padding:0.4rem 0.55rem; }
  .daily-banner { margin-top:0.3rem; margin-bottom:0.35rem; }
}
.pdf-btn {
  display:inline-flex;align-items:center;gap:4px;padding:3px 10px;
  border-radius:980px;font-size:max(12px,0.72rem);font-weight:600;
  color:var(--ink2);background:var(--surface2);
  border:1px solid var(--border);text-decoration:none;
  white-space:nowrap;flex-shrink:0;transition:background 0.15s,border-color 0.15s,color 0.15s;
  line-height:1;
}
.pdf-btn:hover { color:var(--ink);background:var(--surface3); }
.pdf-btn .pdf-ic { opacity:0.8;flex-shrink:0; }
.pdf-bar {
  display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;
  padding:2px 4px 12px;direction:ltr;
}
.pdf-bar-label { font-size:max(12px,0.72rem);color:var(--ink3);font-weight:600; }
.sefaria-btn {
  display:inline-flex;align-items:center;gap:4px;padding:3px 10px;
  border-radius:980px;font-size:max(12px,0.72rem);
  font-weight:600;color:#004E5F;background:rgba(0,78,95,0.08);
  border:1px solid rgba(0,78,95,0.22);text-decoration:none;
  white-space:nowrap;flex-shrink:0;transition:background 0.15s,border-color 0.15s;
  line-height:1;
}
.sefaria-btn:hover { background:rgba(0,78,95,0.15);border-color:rgba(0,78,95,0.4); }
html[data-dark] .sefaria-btn { color:#5fc8d8;background:rgba(95,200,216,0.1);border-color:rgba(95,200,216,0.22); }
html[data-dark] .sefaria-btn:hover { background:rgba(95,200,216,0.18); }
/* ── Sefer HaMidos (SHM) ── */
:root { --shm:#8B6914; --shm-light:rgba(139,105,20,0.1); }
html[data-dark] { --shm:#c9a227; }
/* ── Dark-mode contrast fixes for hardcoded expanded-card colours ──────── */
html[data-dark] .eitzos-row { background:rgba(45,180,80,0.10) !important; }
html[data-dark] .eitzos-row .topic-tl { color:#5fd07e !important; }
html[data-dark] .eitzos-label { color:#5fd07e !important; }
html[data-dark] .badge-midos { color:#5fd07e; background:rgba(45,180,80,0.14); }
html[data-dark] .badge-sipurim { color:#8e8cff; background:rgba(120,118,235,0.18); }
html[data-dark] .badge-sichos { color:#e2954a; background:rgba(226,149,74,0.16); }
html[data-dark] .lt-num { color:#e2954a; }
html[data-dark] .lt-label { color:#e2954a; background:rgba(226,149,74,0.16); }
html[data-dark] .tefila-badge { color:#e2954a; background:rgba(226,149,74,0.16); }
/* var(--ink) is light in dark mode — pair it with dark text, not #fff */
html[data-dark] .torah-combined,
html[data-dark] .sec-btn-all.active,
html[data-dark] .entry.open .card-toggle-arrow,
html[data-dark] .lh-entry.open .card-toggle-arrow,
html[data-dark] .parsha-entry.open .card-toggle-arrow,
html[data-dark] .lt-entry.open .card-toggle-arrow,
html[data-dark] .halacha-block.open .card-toggle-arrow,
html[data-dark] .daily-explore-btn:hover { color:var(--bg); }
html[data-dark] .daily-assoc-lt { color:#e2954a; background:rgba(226,149,74,0.16); }
html[data-dark] .daily-assoc-le { color:#5fd07e; background:rgba(45,180,80,0.14); }
html[data-dark] .sec-btn-src { color:#8e8cff; border-color:rgba(120,118,235,0.35); }
html[data-dark] .sec-btn-src:hover, html[data-dark] .sec-btn-src.active { background:rgba(120,118,235,0.18); border-color:#8e8cff; color:#a5a3ff; }
/* Dark counterparts for the soft-tint chelek chips. The light rules above set a
   DARK accent as the label colour, which would be unreadable on the dark tint
   (~2.5:1), so each one is re-lightened here. The --oc/--yd/--cm/--ae/--hk
   variables themselves are deliberately NOT redefined for dark mode: the little
   .sec-chelek circle badges fill with those same colours and carry white text,
   so lightening the variable would break them instead. Scope to the chip class. */
html[data-dark] .sec-btn-oc { color:#5aa9ff; border-color:rgba(90,169,255,0.35); }
html[data-dark] .sec-btn-oc:hover, html[data-dark] .sec-btn-oc.active { background:rgba(90,169,255,0.18); border-color:#5aa9ff; color:#7dbcff; }
html[data-dark] .sec-btn-yd { color:#4fc46a; border-color:rgba(79,196,106,0.35); }
html[data-dark] .sec-btn-yd:hover, html[data-dark] .sec-btn-yd.active { background:rgba(79,196,106,0.18); border-color:#4fc46a; color:#72d489; }
html[data-dark] .sec-btn-cm { color:#b98ae0; border-color:rgba(185,138,224,0.35); }
html[data-dark] .sec-btn-cm:hover, html[data-dark] .sec-btn-cm.active { background:rgba(185,138,224,0.18); border-color:#b98ae0; color:#cba7e9; }
html[data-dark] .sec-btn-ae { color:#ff9350; border-color:rgba(255,147,80,0.35); }
html[data-dark] .sec-btn-ae:hover, html[data-dark] .sec-btn-ae.active { background:rgba(255,147,80,0.18); border-color:#ff9350; color:#ffab77; }
html[data-dark] .sec-btn-hk { color:#a8a8ae; border-color:rgba(168,168,174,0.35); }
html[data-dark] .sec-btn-hk:hover, html[data-dark] .sec-btn-hk.active { background:rgba(168,168,174,0.18); border-color:#a8a8ae; color:#c4c4c9; }
/* Anatomy of the Soul: --aos stays dark purple in both themes, so an ACTIVE chip
   (solid --aos fill) correctly keeps white text. Only the unselected/hover label
   needs lightening against the dark surface. */
html[data-dark] .sec-btn-aos { color:#b3a0ff; border-color:rgba(179,160,255,0.35); }
html[data-dark] .sec-btn-aos:hover { background:rgba(179,160,255,0.18); border-color:#b3a0ff; color:#b3a0ff; }
/* Restated because the rule above is equal-specificity and later than
   `.sec-btn-aos.active`, so without this the lightened label colour would win
   and sit at 2.3:1 on the solid --aos fill. White on --aos is 6.3:1. */
html[data-dark] .sec-btn-aos.active { background:var(--aos); border-color:var(--aos); color:var(--on-accent); }
.sec-btn-shm { color:var(--shm); border-color:rgba(139,105,20,0.22); }
.sec-btn-shm:hover, .sec-btn-shm.active { background:var(--shm); border-color:var(--shm); color:#fff; }
.shm-aphorism { display:flex; gap:10px; padding:6px 0; border-bottom:1px solid var(--border); align-items:flex-start; }
.shm-aphorism:last-child { border-bottom:none; }
.shm-num { flex-shrink:0; min-width:1.8rem; font-size:max(12px,0.72rem); font-weight:700; color:var(--shm); font-family:var(--font-ui); text-align:center; padding-top:3px; }
.shm-en { font-size:0.88rem; color:var(--ink); line-height:1.6; direction:ltr; }
.shm-he { font-size:0.85rem; color:var(--ink2); line-height:1.55; direction:rtl; text-align:right; margin-bottom:3px; font-family:var(--font-ui); }
.shm-part-label { font-size:max(12px,0.68rem); font-style:italic; color:var(--ink3); margin:10px 0 5px; text-transform:uppercase; letter-spacing:0.06em; }
.shm-loading { padding:18px 0; color:var(--ink2); font-size:0.85rem; text-align:center; direction:ltr; }
.shm-letter-pill { flex-shrink:0; min-width:2.2rem; text-align:center; font-family:var(--font-ui); font-size:1.2rem; font-weight:700; color:var(--shm); }
@media(max-width:600px){
  .shm-aphorism { gap:7px; }
  .shm-en { font-size:0.84rem; }
}

/* ══ MOBILE NAV + SECTION SHEET ════════════════════════════════════════════
   The desktop 13-button strip is hidden on phones and replaced by a single
   "current sefer" pill that opens a clean bottom-sheet grid. All original
   buttons (btnLM…btnHIS) remain in the DOM so existing JS keeps working. */
.mobile-nav { display:none; } .mobile-nav-hint { display:none; }
.mobile-menu, .mobile-menu-backdrop { display:none; }
.section-sheet-overlay { display:none; }

/* Mobile-only structures stay hidden on desktop/tablet */
@media (min-width:601px){
  .mobile-nav { display:none !important; } .mobile-nav-hint { display:none !important; }
  #mobileDarkToggle, #mobileGlobalSearchBtn { display:none !important; }
}

@media (max-width:600px){
  /* --- Slimmer hero so search + content sit higher --- */
  .hero { padding:1.4rem 1rem 1rem; }
  .hero-eyebrow { margin-bottom:0.5rem; font-size:max(12px,0.66rem); }
  .hero h1 { font-size:1.5rem; line-height:1.25; }
  .hero-sub { display:block; font-size:0.78rem; margin-top:0.4rem; }

  /* --- Hide desktop strip + floating sun/moon + search (replaced below) --- */
  .mode-toggle { display:none !important; }
  #darkToggleBtn, #globalSearchBtn, #infoBtn, #favNavBtn { display:none !important; }

  /* one-time first-visit nudge so users notice the picker is tappable */
  @keyframes mspNudge {
    0%,100% { transform:scale(1); }
    18% { transform:scale(1.045); }
    38% { transform:scale(0.99); }
    58% { transform:scale(1.03); }
    78% { transform:scale(0.995); }
  }
  .mobile-section-picker.msp-nudge {
    animation:mspNudge 1.15s ease-in-out 2;
    box-shadow:0 0 0 3px rgba(94,61,232,0.28), 0 2px 12px rgba(94,61,232,0.1), 0 1px 3px rgba(0,0,0,0.05);
  }

    /* --- Mobile top bar: one line, and PINNED while you scroll ---
       The book you're in + the way to switch it persist; filters + search
       scroll away. It sits outside .hero, so sticky actually works here. */
  .mobile-nav {
    display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-start;
    gap:0.4rem; width:100%;
    position:sticky; top:0; z-index:200;
    padding:0.5rem 0.9rem calc(0.5rem + 1px);
    background:rgba(242,242,247,0.9);
    backdrop-filter:saturate(180%) blur(20px); -webkit-backdrop-filter:saturate(180%) blur(20px);
    border-bottom:1px solid var(--border);
  }
  html[data-dark] .mobile-nav { background:rgba(26,23,38,0.9); }
  /* In the installed app / PWA the notch pushes the body down; pin below it. */
  html.safe-top .mobile-nav { top:var(--sat); }
  .mobile-nav-hint {
    display:block; direction:ltr; text-align:right;
    margin:1.0rem 0.3rem 0.3rem 0;
    font-family:inherit; font-size:max(12px,0.72rem); font-weight:600;
    color:var(--accent); letter-spacing:0.01em;
  }
  .mobile-nav-hint .mnh-arrow { font-size:0.8rem; }
  .mobile-nav-hint + .mobile-nav { margin-top:0; }
  .mobile-section-picker {
    flex:1 1 auto; min-width:0; order:0;
    display:flex; align-items:center; gap:0.5rem;
    font-family:inherit; cursor:pointer; text-align:right;
    padding:0.5rem 0.7rem;
    border:1px solid rgba(94,61,232,0.2);
    border-radius:12px;
    background:rgba(255,255,255,0.72);
    backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
    box-shadow:0 2px 12px rgba(94,61,232,0.1), 0 1px 3px rgba(0,0,0,0.05);
    transition:transform 0.12s, box-shadow 0.15s;
  }
  .mobile-section-picker:active { transform:scale(0.985); }
  .msp-grid-icon {
    flex-shrink:0; width:1.3rem; height:1.3rem; border-radius:7px;
    background:var(--accent); display:grid; grid-template-columns:1fr 1fr;
    grid-template-rows:1fr 1fr; gap:2px; padding:4px;
  }
  .msp-grid-icon span { background:#fff; border-radius:1.5px; }
  .msp-label { flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.12; }
  .msp-label .msp-he { font-size:0.9rem; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .msp-label .msp-en { font-size:max(12px,0.64rem); font-weight:500; color:var(--ink2); direction:ltr; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .msp-chev { flex-shrink:0; font-size:0.95rem; color:var(--accent); font-weight:700; }
  .mobile-nav .mobile-icon-btn {
    flex-shrink:0; width:2.4rem; height:2.4rem; border-radius:11px;
    display:flex; align-items:center; justify-content:center;
    font-size:1.1rem; line-height:1; cursor:pointer; padding:0;
    border:1px solid rgba(94,61,232,0.2);
    background:rgba(255,255,255,0.72); color:var(--accent);
    backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
    box-shadow:0 2px 12px rgba(94,61,232,0.1), 0 1px 3px rgba(0,0,0,0.05);
    transition:transform 0.12s;
  }
  .mobile-nav .mobile-icon-btn:active { transform:scale(0.93); }
  #mobileMenuBtn { color:var(--accent); }
  #mobileInspireBtn { color:var(--accent); }
  #mobileFavBtn { color:var(--fav); }

  /* --- Bottom sheet --- */
  .section-sheet-overlay {
    display:block; position:fixed; inset:0; z-index:1000;
    background:rgba(0,0,0,0); visibility:hidden;
    transition:background 0.28s ease, visibility 0s linear 0.28s;
  }
  .section-sheet-overlay.open {
    background:rgba(0,0,0,0.45); visibility:visible;
    transition:background 0.28s ease;
  }
  .section-sheet {
    position:absolute; left:0; right:0; bottom:0;
    background:var(--surface);
    border-radius:22px 22px 0 0;
    padding:0.5rem 1rem calc(1.1rem + var(--sab));
    box-shadow:0 -8px 40px rgba(0,0,0,0.25);
    transform:translateY(100%); transition:transform 0.3s cubic-bezier(0.32,0.72,0,1);
    max-height:88vh; overflow-y:auto;
  }
  .section-sheet-overlay.open .section-sheet { transform:translateY(0); }
  .section-sheet-handle {
    width:38px; height:4px; border-radius:980px; background:var(--ink3);
    opacity:0.4; margin:0.5rem auto 0.4rem;
  }
  .section-sheet-head {
    display:flex; align-items:center; justify-content:space-between;
    padding:0.2rem 0.25rem 0.7rem;
  }
  .section-sheet-title { font-size:0.95rem; font-weight:700; color:var(--ink); direction:ltr; }
  .section-sheet-close {
    width:1.9rem; height:1.9rem; border-radius:50%; border:none; cursor:pointer;
    background:var(--surface3); color:var(--ink2); font-size:0.8rem; line-height:1;
    display:flex; align-items:center; justify-content:center;
  }
  .section-sheet-grid {
    display:grid; grid-template-columns:1fr 1fr; gap:0.55rem;
  }
  .ss-card {
    display:flex; flex-direction:column; gap:0.15rem; align-items:flex-start;
    font-family:inherit; cursor:pointer; text-align:right;
    padding:0.75rem 0.8rem; border-radius:14px;
    border:1.5px solid var(--border); background:var(--surface2);
    transition:transform 0.1s, border-color 0.15s, background 0.15s;
  }
  .ss-card:active { transform:scale(0.96); }
  .ss-card .ss-he { font-size:0.95rem; font-weight:700; color:var(--ink); line-height:1.2; }
  .ss-card .ss-en { font-size:max(12px,0.68rem); font-weight:500; color:var(--ink2); direction:ltr; }
  .ss-card.active {
    background:var(--accent); border-color:var(--accent);
    box-shadow:0 3px 12px rgba(94,61,232,0.3);
  }
  .ss-card.active .ss-he, .ss-card.active .ss-en { color:#fff; }

  /* Lock background scroll while sheet is open */
  body.sheet-open { overflow:hidden; }

  /* Hide keyboard hint on phones (no physical keyboard) */
  .search-kb-hint { display:none !important; }

  /* ── Mobile "More" menu (hamburger) ───────────────────────────────────
     Holds the set-once controls (dark mode, about, text size) so the top
     bar stays one line. */
  .mobile-menu-backdrop {
    display:block; position:fixed; inset:0; z-index:1500;
    background:transparent; opacity:0; pointer-events:none; transition:opacity 0.2s;
  }
  .mobile-menu-backdrop.open { opacity:1; pointer-events:auto; }
  .mobile-menu {
    display:block; position:fixed; z-index:1600;
    top:calc(var(--sat, 0px) + 3.05rem); left:0.9rem;
    min-width:12.5rem; padding:0.35rem;
    background:var(--surface); border:1px solid var(--border);
    border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,0.22);
    opacity:0; transform:translateY(-6px) scale(0.98); transform-origin:top left;
    pointer-events:none; transition:opacity 0.16s, transform 0.16s;
  }
  .mobile-menu.open { opacity:1; transform:none; pointer-events:auto; }
  .mm-item {
    display:flex; align-items:center; gap:0.7rem; width:100%;
    font-family:inherit; font-size:0.92rem; font-weight:600; color:var(--ink);
    text-align:left; direction:ltr; background:none; border:none; cursor:pointer;
    padding:0.6rem; border-radius:10px;
  }
  .mm-item:active { background:var(--surface3); }
  .mm-ic { flex-shrink:0; width:1.4rem; height:1.4rem; display:flex; align-items:center; justify-content:center; font-size:1.05rem; color:var(--accent); }
  .mm-label { flex:1; }
  .mm-sep { height:1px; background:var(--border); margin:0.25rem 0.4rem; }
  .mm-fs { cursor:default; }
  .mm-fs-ctrl { display:inline-flex; gap:0.3rem; flex-shrink:0; }
  .mm-fs-btn {
    width:2rem; height:2rem; border-radius:8px; border:1px solid var(--border);
    background:var(--surface2); color:var(--ink); font-family:inherit; cursor:pointer;
    display:flex; align-items:center; justify-content:center; font-size:0.85rem; line-height:1;
  }
  .mm-fs-btn.mm-fs-lg { font-size:1.15rem; }
  .mm-fs-btn:active { transform:scale(0.92); }

  /* ── Search + filter block: scrolls away now (the book bar pins), compact ─ */
  .search-bar { position:static; padding-top:0.3rem; }
  /* Tighten the space above the field (resume chip → search box). */
  .resume-chip { margin-bottom:0.35rem; }
  /* The scope row is empty online (its buttons moved to the bar / gear menu), so
     hide it — otherwise it leaves a blank line above the field. It reappears only
     when the offline notice needs to show. */
  .search-inner > .search-scope-row { display:none; }
  .search-inner > .search-scope-row:has(.offline-pill.show) { display:flex; justify-content:center; }
  /* Everything below the field goes onto ONE line, the same for every section:
     Filters · result-count pill · Expand · Collapse · Favourite · Share.
     The field stays full width above; the filter chips (when opened) drop
     full width below. Achieved by reordering the search-inner children, so
     desktop (which stays a plain column) is untouched. */
  .search-inner { flex-flow:row wrap; align-items:center; justify-content:center; column-gap:0.4rem; row-gap:0.35rem; }
  .search-inner > .search-scope-row { flex:1 1 100%; order:0; }
  .search-inner > .search-input-wrap { flex:1 1 100%; order:1; }
  .search-inner > .filters-toggle { flex:0 0 auto; order:2; }
  .search-inner > #searchToolbar { flex:0 0 auto; order:3; min-width:0; }
  /* min-width:0 lets the panel shrink to the screen so its horizontally-
     scrolling chip rows (.lh-sec-row) scroll instead of overflowing off-screen
     where the chips can't be reached. Applies to every section's filters. */
  .search-inner > .filters-body { flex:1 1 100%; order:4; min-width:0; }
  /* The control cluster shrinks to its contents and centres as one group. */
  #searchToolbar { justify-content:center; }
  .ft-word, .ft-heb, .ec-all { display:none; }
  /* Drop the redundant "Search all content" button (the bar's search icon does
     it), the desktop Inspire (now in the bar) and A/A (now in the More menu).
     The scope row then collapses to ~0 unless the offline notice is showing. */
  .search-scope-all,
  .search-scope-row .inspire-btn,
  .search-scope-row .fs-ctrl { display:none !important; }
  /* Result count now lives INSIDE the search field (right side); hide the
     toolbar copy on phones. */
  #resultsCount { display:none; }
  /* Search field: magnifier moves to the LEFT; the count pill sits on the RIGHT
     (where the magnifier used to be); English-first placeholder in between. */
  .search-icon { left:0.75rem; right:auto; }
  .search-inner input { padding-left:2.1rem; padding-right:3.3rem; }
  .search-clear { left:auto; right:0.55rem; }
  .field-count {
    display:inline-block; position:absolute; right:0.5rem; top:50%; transform:translateY(-50%);
    font-size:max(12px,0.7rem); font-weight:700; line-height:1.4; pointer-events:none;
    color:var(--accent); background:rgba(94,61,232,0.1);
    border:1px solid rgba(94,61,232,0.2); border-radius:980px; padding:1px 7px;
  }
  html[data-dark] .field-count { color:#c4b5fd; background:rgba(150,120,255,0.15); border-color:rgba(150,120,255,0.28); }
  /* While typing, the clear button takes the right slot — hide the count then;
     while empty, hide the clear button so only the count shows. */
  #searchInput:not(:placeholder-shown) ~ .field-count { display:none; }
  #searchInput:placeholder-shown ~ .search-clear { display:none !important; }
  /* The control row's icon pills — Filters, Expand, Collapse, Share, Favourite —
     all share one comfortable tap size (~42px). */
  /* Filters toggle → a funnel icon pill; solid purple when filters are open. */
  .filters-toggle {
    flex:0 0 auto; padding:0; width:2.35rem; height:2.35rem; border-radius:11px;
    border:1px solid rgba(94,61,232,0.2); background:var(--accent-light);
    display:flex; align-items:center; justify-content:center;
  }
  .filters-toggle .filters-toggle-label, .filters-toggle .filters-toggle-arrow { display:none; }
  .filters-icon { display:flex; align-items:center; justify-content:center; color:var(--accent); }
  .filters-icon svg { width:17px; height:17px; }
  html[data-dark] .filters-icon { color:#c4b5fd; }
  .filters-toggle.open { background:var(--accent); border-color:var(--accent); }
  .filters-toggle.open .filters-icon { color:#fff; }
  /* Expand / Collapse → accent icon pills (plus-box / minus-box). */
  .ec-txt { display:none; }
  .ec-ic { display:flex; align-items:center; justify-content:center; }
  .ec-ic svg { width:17px; height:17px; }
  #expandCollapseWrap { gap:0.4rem; }
  #expandCollapseWrap .lh-view-btn {
    padding:0; width:2.35rem; height:2.35rem; border-radius:11px;
    border:1px solid rgba(94,61,232,0.2); background:var(--accent-light); color:var(--accent);
    display:flex; align-items:center; justify-content:center;
  }
  html[data-dark] #expandCollapseWrap .lh-view-btn { color:#c4b5fd; }
  /* Favourite + Share ride on this same row (placed into #toolbarRight by
     otzarPlaceFavBar); their size/colour is set in the #toolbarRight block that
     applies at every width. Just centre the row here. */
  #toolbarRight { flex-wrap:wrap; justify-content:center; gap:0.4rem; }

  /* ── Daily banner: one line, not sixty pixels of packaging ────────────── */
  .daily-banner { padding:0.35rem 0.7rem; }
  .daily-banner-header { padding:0.15rem 0.2rem !important; }
  #dailyBannerArrow { font-size:max(12px,0.68rem) !important; padding:2px 8px !important; }
  .daily-date-row { font-size:0.76rem; gap:0.4rem; }
}

/* ══ SITE-WIDE SEARCH ══════════════════════════════════════════════════════ */
/* Desktop launch icon — sits just left of the sun/moon */
.global-search-btn {
  position:fixed; top:14px; right:60px; z-index:9999;
  width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:1.5px solid rgba(94,61,232,0.18);
  background:rgba(255,255,255,0.82); color:var(--accent);
  cursor:pointer; backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  transition:all 0.2s; box-shadow:0 2px 8px rgba(0,0,0,0.10); padding:0;
}
.global-search-btn:hover { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
html[data-dark] .global-search-btn {
  background:rgba(44,44,46,0.85); color:#c4b5fd; border-color:rgba(255,255,255,0.15);
}
html[data-dark] .global-search-btn:hover { background:var(--accent); color:var(--on-accent); }

/* Mobile icon buttons share one look */
.mobile-icon-btn svg { display:block; }
#mobileGlobalSearchBtn { color:var(--accent); }

/* Overlay */
.gs-overlay {
  position:fixed; inset:0; z-index:2000;
  background:var(--bg);
  display:none; flex-direction:column;
}
.gs-overlay.open { display:flex; animation:gsFade 0.18s ease; }
body.sheet-open { overflow:hidden; }

/* Chapter cards (Shivchei/Sichos HaRan, Sefer HaMidos, Chayei Moharan) — LM look,
   but titles are full sentences so let them wrap instead of truncating. */
.chapter-entry { margin-bottom:0.75rem; }
.chapter-entry .entry-header { align-items:flex-start; }
.chapter-entry .entry-num { padding-top:0.1rem; }
.chapter-entry .entry-title { white-space:normal; overflow:visible; text-overflow:clip; font-weight:700; }
.chapter-entry.open .entry-title-en { display:block; margin-top:0.25rem; }
/* The English heading is a full LTR sentence sitting inside a direction:rtl page.
   It only ever got direction:ltr from `.entry.open .entry-title-en` — so on a
   COLLAPSED .enc card (Chayei Moharan, Shivchei/Sichos HaRan, Sefer HaMidos,
   Tikkun HaKlali) the sentence was laid out RTL: right-aligned, with its leading
   " · " thrown to the far right, where it read like a full stop at the start.
   Force LTR + left alignment for BOTH states, and isolate it so the separator
   can never be re-ordered by the surrounding Hebrew. */
.chapter-entry .entry-title-en { direction:ltr; text-align:left; unicode-bidi:isolate; }
/* .enc cards keep their English heading visible even when collapsed */
.chapter-entry.enc .entry-title-en { display:block; margin-top:0.25rem; }
.chapter-entry .card-toggle-arrow { align-self:flex-start; }
/* While the search overlay is open, hide the floating desktop icons so they don't overlap it */
body.sheet-open #globalSearchBtn,
body.sheet-open #favNavBtn,
body.sheet-open #darkToggleBtn { display:none !important; }
@keyframes gsFade { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }
.gs-topbar {
  display:flex; align-items:center; gap:0.6rem;
  padding:calc(0.7rem + var(--sat)) 1rem 0.7rem;
  border-bottom:1px solid var(--border);
  background:var(--surface); position:sticky; top:0;
}
.gs-search-wrap { position:relative; flex:1; display:flex; align-items:center; min-width:0; }
.gs-search-icon { position:absolute; right:0.9rem; color:var(--ink3); pointer-events:none; }
.gs-clear { position:absolute; left:0.7rem; background:none; border:none; color:var(--ink3); cursor:pointer; font-size:0.8rem; padding:0.1rem 0.3rem; border-radius:50%; line-height:1; }
.gs-clear:hover { color:var(--ink); background:var(--surface3); }
#gsInput {
  width:100%; padding:0.7rem 2.6rem 0.7rem 2.2rem; font-family:inherit; font-size:1.05rem;
  border:1.5px solid var(--accent); border-radius:980px; background:var(--surface);
  color:var(--ink); outline:none; direction:ltr; text-align:left; box-shadow:0 0 0 3px rgba(94,61,232,0.1);
}
#gsInput[dir="rtl"] { text-align:right; }
#gsInput::placeholder { color:var(--ink3); }
.gs-close {
  flex-shrink:0; font-family:inherit; font-size:0.9rem; font-weight:700; color:var(--accent);
  background:none; border:none; cursor:pointer; padding:0.4rem 0.3rem; white-space:nowrap;
}
.gs-summary { padding:0.6rem 1.2rem 0; font-size:0.78rem; color:var(--ink3); direction:ltr; max-width:780px; margin:0 auto; width:100%; }
.gs-results { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:0.8rem 1rem 3rem; max-width:780px; margin:0 auto; width:100%; }
.gs-empty { text-align:center; padding:3.5rem 1rem; color:var(--ink3); font-size:0.95rem; direction:ltr; line-height:1.6; }

/* Collapsible per-sefer groups */
.gs-group { margin-bottom:0.8rem; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--surface); box-shadow:var(--shadow-sm); }
.gs-group-header {
  width:100%; display:flex; align-items:center; gap:0.6rem; cursor:pointer;
  font-family:inherit; text-align:right; padding:0.8rem 1rem;
  background:var(--accent-light); border:none; color:var(--ink);
  transition:background 0.15s;
}
.gs-group-header:hover { background:var(--accent-mid); }
.gs-group-arrow { color:var(--accent); font-size:0.85rem; transition:transform 0.2s; flex-shrink:0; }
.gs-group.open .gs-group-arrow { transform:rotate(90deg); }
.gs-group-title { flex:1; font-size:0.98rem; font-weight:700; color:var(--accent); min-width:0; }
.gs-group-count { flex-shrink:0; font-size:max(12px,0.7rem); font-weight:600; color:var(--accent); background:var(--surface); border:1px solid var(--accent-mid); border-radius:980px; padding:0.15rem 0.6rem; direction:ltr; white-space:nowrap; }
.gs-group-body { display:none; padding:0.6rem 0.8rem 0.8rem; }
.gs-group.open .gs-group-body { display:block; }
/* Toolbar: summary text + bulk open/collapse controls */
.gs-toolbar { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; max-width:780px; margin:0 auto; width:100%; padding:0.6rem 1.2rem 0; }
.gs-toolbar .gs-summary { padding:0; margin:0; max-width:none; width:auto; flex:1; min-width:0; }
.gs-bulk { display:flex; gap:0.35rem; flex-shrink:0; }
.gs-bulk-btn { font-family:inherit; font-size:max(12px,0.7rem); font-weight:600; padding:0.25rem 0.7rem; border:1.5px solid var(--border); border-radius:980px; background:var(--surface); color:var(--ink2); cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.gs-bulk-btn:hover { border-color:var(--accent); color:var(--accent); }
/* Blue jump-to-top arrow inside the search overlay */
.gs-top-btn {
  position:absolute; bottom:calc(1.2rem + var(--sab)); right:1.2rem; z-index:2100;
  width:2.6rem; height:2.6rem; border-radius:50%;
  background:var(--accent); color:var(--on-accent); border:none; cursor:pointer;
  font-size:1.1rem; font-weight:700; line-height:1;
  box-shadow:0 4px 16px rgba(94,61,232,0.35);
  opacity:0; pointer-events:none; transition:opacity 0.2s, transform 0.2s;
  display:flex; align-items:center; justify-content:center;
}
.gs-top-btn.visible { opacity:1; pointer-events:auto; }
.gs-top-btn:hover { transform:translateY(-2px); background:var(--accent2); }
@media (max-width:600px){
  #gsInput { font-size:1rem; }
  .gs-results, .gs-summary { padding-left:0.7rem; padding-right:0.7rem; }
  .gs-toolbar { padding-left:0.7rem; padding-right:0.7rem; }
  .gs-bulk-btn { font-size:max(12px,0.65rem); padding:0.22rem 0.55rem; }
  .gs-group-body { padding:0.5rem 0.5rem 0.7rem; }
  .gs-top-btn { bottom:calc(1rem + var(--sab)); right:1rem; }
}

/* ── INFO / WELCOME BUTTON + MODAL ──────────────────────────────────────── */
.info-btn {
  position:fixed; top:14px; right:104px; z-index:9999;
  width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:1.05rem; line-height:1; font-weight:700;
  border:1.5px solid rgba(94,61,232,0.18);
  background:rgba(255,255,255,0.82); color:var(--accent);
  cursor:pointer; backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  transition:all 0.2s; box-shadow:0 2px 8px rgba(0,0,0,0.10); padding:0;
}
.info-btn:hover { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
html[data-dark] .info-btn {
  background:rgba(44,44,46,0.85); color:#c4b5fd; border-color:rgba(255,255,255,0.15);
}
html[data-dark] .info-btn:hover { background:var(--accent); color:var(--on-accent); }
body.sheet-open #infoBtn { display:none !important; }
#mobileInfoBtn { color:var(--accent); }

/* Favourites — desktop floating star, sits left of the info button */
.fav-nav-btn {
  position:fixed; top:14px; right:148px; z-index:9999;
  width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:1.5px solid rgba(94,61,232,0.18);
  background:rgba(255,255,255,0.82); color:var(--fav);
  cursor:pointer; backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  transition:all 0.2s; box-shadow:0 2px 8px rgba(0,0,0,0.10); padding:0;
}
.fav-nav-btn svg { width:20px; height:20px; display:block; }
.fav-nav-btn:hover { background:var(--fav); color:#fff; border-color:var(--fav); }
.fav-nav-btn.active { background:var(--fav); color:#fff; border-color:var(--fav); }
.fav-nav-btn.active svg { fill:currentColor; }
html[data-dark] .fav-nav-btn {
  background:rgba(44,44,46,0.85); border-color:rgba(255,255,255,0.15);
}
html[data-dark] .fav-nav-btn:hover { background:var(--fav); color:#fff; }
body.sheet-open #favNavBtn { display:none !important; }
#mobileFavBtn { color:var(--fav); }
#mobileFavBtn.active { background:var(--fav); color:#fff; border-color:var(--fav); }
#mobileFavBtn.active svg { fill:currentColor; }

/* ── Kabbalah Basics: buy-the-book popup ──────────────────────────────── */
.kabbook-overlay {
  position:fixed; inset:0; z-index:3100;
  display:none; align-items:flex-start; justify-content:center;
  background:rgba(20,16,40,0.55); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  padding:max(2.5vh,18px) 16px; overflow-y:auto; -webkit-overflow-scrolling:touch;
}
.kabbook-overlay.open { display:flex; animation:gsFade 0.2s ease; }
.kabbook-card {
  background:var(--surface); color:var(--ink);
  border:1px solid var(--border); border-radius:20px;
  box-shadow:var(--shadow-lg);
  width:100%; max-width:440px; margin:auto;
  position:relative; overflow:hidden;
  display:flex; flex-direction:column; max-height:92vh;
}
.kabbook-head {
  position:sticky; top:0; z-index:2;
  background:linear-gradient(160deg, var(--kab) 0%, var(--kab-mid) 140%);
  color:var(--on-accent); padding:1.4rem 1.4rem 1.2rem; text-align:center;
}
.kabbook-head .kabbook-icon {
  display:block; width:46px; height:46px; margin:0 auto 0.55rem;
  color:#fff;
}
.kabbook-head h2 { font-size:1.25rem; font-weight:800; margin:0; line-height:1.25; }
.kabbook-head .kabbook-by { font-size:0.85rem; font-weight:500; color:rgba(255,255,255,0.9); margin-top:0.25rem; }
.kabbook-close {
  position:absolute; top:10px; left:10px;
  width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,0.22); color:#fff; border:none;
  font-size:1.3rem; line-height:1; cursor:pointer; transition:background 0.18s;
}
.kabbook-close:hover { background:rgba(255,255,255,0.4); }
.kabbook-body { padding:1.2rem 1.4rem 1.4rem; overflow-y:auto; -webkit-overflow-scrolling:touch; direction:ltr; text-align:left; }
.kabbook-body p { font-size:0.93rem; color:var(--ink); margin:0 0 1rem; line-height:1.6; text-align:left; direction:ltr; unicode-bidi:plaintext; }
.kabbook-buy {
  display:flex; align-items:center; justify-content:center; gap:0.5rem;
  width:100%; box-sizing:border-box;
  background:var(--kab); color:var(--on-accent); text-decoration:none;
  font-size:1rem; font-weight:700; padding:0.85rem 1rem;
  border-radius:14px; transition:filter 0.18s, transform 0.06s;
}
.kabbook-buy:hover { filter:brightness(1.08); }
.kabbook-buy:active { transform:scale(0.99); }
.kabbook-region { display:block; text-align:center; font-size:0.8rem; color:var(--ink2); margin:0.6rem 0 0; }
.kabbook-toggle {
  display:block; width:100%; margin-top:0.9rem; padding:0;
  background:none; border:none; cursor:pointer;
  color:var(--kab); font-size:0.85rem; font-weight:600; text-align:center;
}
.kabbook-toggle:hover { text-decoration:underline; }
.kabbook-list { display:none; margin-top:0.7rem; border-top:1px solid var(--border); padding-top:0.7rem; }
.kabbook-list.open { display:block; }
.kabbook-list a {
  display:flex; justify-content:space-between; align-items:center;
  padding:0.55rem 0.2rem; text-decoration:none;
  color:var(--ink); font-size:0.9rem; border-bottom:1px solid var(--border);
}
.kabbook-list a:last-child { border-bottom:none; }
.kabbook-list a:hover { color:var(--kab); }
.kabbook-list a span.kabbook-go { color:var(--kab); font-weight:700; }

/* ── Favourites: star toggle, section bar, tab + view ─────────────────────── */
.fav-toggle-btn.active { background:var(--fav) !important; color:#fff !important; box-shadow:0 2px 8px rgba(220,164,0,0.35) !important; }
.fav-toggle-btn:not(.active):hover { background:var(--fav-light) !important; color:var(--fav) !important; }

/* star injected into each card header */
.fav-star {
  flex:0 0 auto; width:30px; height:30px; padding:0;
  border:none; background:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--ink3); border-radius:8px;
  transition:color .15s, background .15s, transform .06s;
  -webkit-tap-highlight-color:transparent;
}
.fav-star:hover { background:var(--fav-light); color:var(--fav); }
.fav-star:active { transform:scale(0.88); }
.fav-star svg { width:18px; height:18px; display:block; }
.fav-star.is-fav { color:var(--fav); }
.fav-star.is-fav svg { fill:currentColor; }

/* Per-card share button (mirrors .fav-star sizing, uses section accent) */
.share-btn {
  flex:0 0 auto; width:30px; height:30px; padding:0;
  border:none; background:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--ink3); border-radius:8px;
  transition:color .15s, background .15s, transform .06s;
  -webkit-tap-highlight-color:transparent;
}
.share-btn:hover { background:var(--accent-light); color:var(--accent); }
.share-btn:active { transform:scale(0.88); }
.share-btn svg { width:17px; height:17px; display:block; }

/* "Open in section" — favourites view only. Same sizing as the star and the
   share button so the three sit as one set at the head of a saved card. */
.fav-goto-btn {
  flex:0 0 auto; width:30px; height:30px; padding:0;
  border:none; background:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--ink3); border-radius:8px;
  transition:color .15s, background .15s, transform .06s;
  -webkit-tap-highlight-color:transparent;
}
.fav-goto-btn:hover { background:var(--accent-light); color:var(--accent); }
.fav-goto-btn:active { transform:scale(0.88); }
.fav-goto-btn svg { width:16px; height:16px; display:block; }
/* One quiet line under "Saved cards" so the arrow is discoverable. */
.fav-goto-hint {
  font-size:0.75rem; color:var(--ink3); line-height:1.5;
  margin:-2px 0 10px; display:flex; align-items:center; gap:6px; flex-wrap:wrap;
}
.fav-goto-hint svg { width:14px; height:14px; flex:0 0 auto; }
/* A saved card carries three controls (star, share, open-in-section). On a phone
   give the set back a few pixels so the title still has room on the top line. */
@media (max-width:600px){
  #resultsArea .fav-cards-block .fav-star,
  #resultsArea .fav-cards-block .share-btn,
  #resultsArea .fav-cards-block .fav-goto-btn { width:27px; height:27px; }
  .fav-goto-hint { font-size:max(12px,0.72rem); }
}

/* Share popover (anchored to the tapped share button) */
.share-pop {
  position:fixed; z-index:9600; min-width:150px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:12px; padding:5px;
  box-shadow:0 10px 30px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
  display:flex; flex-direction:column; gap:2px;
  -webkit-tap-highlight-color:transparent;
}
.share-pop button {
  display:flex; align-items:center; gap:9px;
  width:100%; padding:9px 11px; border:none; background:none;
  border-radius:8px; cursor:pointer; text-align:left;
  font-family:inherit; font-size:0.88rem; font-weight:500; color:var(--ink);
  transition:background .12s;
}
.share-pop button:hover { background:var(--surface2); }
.share-pop button:active { background:var(--accent-light); }
.share-pop button svg { width:17px; height:17px; flex:0 0 auto; color:var(--accent); }

/* Copy confirmation toast */
.share-toast {
  position:fixed; left:50%; bottom:28px; transform:translateX(-50%) translateY(12px);
  z-index:9700; background:var(--ink); color:var(--surface);
  padding:10px 18px; border-radius:980px; font-size:0.86rem; font-weight:600;
  box-shadow:0 8px 24px rgba(0,0,0,0.22);
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
}
.share-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
html[data-dark] .share-toast { background:var(--surface2); color:var(--ink); }

/* "Favourite this section" bar above the section's cards */
.fav-section-bar { display:flex; justify-content:flex-end; margin:0 0 0.75rem; }
/* On desktop, centre the section-level control rows (Favourite/Share section
   and the "Full sefer" download bar) within the centred content column so the
   whole page reads as balanced. Mobile (≤600px) is left exactly as it was. */
@media (min-width:601px){
  .fav-section-bar { justify-content:center; }
  .pdf-bar { justify-content:center; }
}
.fav-section-btn {
  display:inline-flex; align-items:center; gap:0.4rem;
  font-family:inherit; font-size:0.82rem; font-weight:600;
  color:var(--ink2); background:var(--surface);
  border:1px solid var(--border); border-radius:980px;
  padding:0.4rem 0.85rem; cursor:pointer; transition:all .15s;
}
.fav-section-btn svg { width:16px; height:16px; }
.fav-section-btn:hover { border-color:var(--fav); color:var(--fav); }
.fav-section-btn.is-fav { color:var(--fav); border-color:var(--fav-mid); background:var(--fav-light); }
.fav-section-btn.is-fav svg { fill:currentColor; }

/* "Share section" button (sits beside Favourite this section) */
.fav-section-bar { gap:0.5rem; flex-wrap:wrap; }
.share-section-btn {
  display:inline-flex; align-items:center; gap:0.4rem;
  font-family:inherit; font-size:0.82rem; font-weight:600;
  color:var(--ink2); background:var(--surface);
  border:1px solid var(--border); border-radius:980px;
  padding:0.4rem 0.85rem; cursor:pointer; transition:all .15s;
  -webkit-tap-highlight-color:transparent;
}
.share-section-btn svg { width:16px; height:16px; }
.share-section-btn:hover { border-color:var(--accent); color:var(--accent); }
.share-section-btn:active { transform:scale(0.96); }

/* When the Favourite/Share bar rides on the control row (#toolbarRight — phones,
   beside the filter/expand icons), force fixed-size icon buttons with no label.
   This holds at EVERY width, so even if the bar is ever placed here on a wide
   screen it stays small icons rather than shrinking into giant wrapping pills.
   Share = accent purple · Favourite = theme gold, matching the other pills. */
#toolbarRight .fav-section-bar { display:inline-flex; gap:0.4rem; margin:0; flex-wrap:nowrap; }
#toolbarRight .fav-section-btn span, #toolbarRight .share-section-btn span { display:none; }
#toolbarRight .fav-section-btn, #toolbarRight .share-section-btn {
  padding:0; width:2.35rem; height:2.35rem; border-radius:11px; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
}
#toolbarRight .fav-section-btn svg, #toolbarRight .share-section-btn svg { width:17px; height:17px; }
#toolbarRight .share-section-btn { background:var(--accent-light); border-color:rgba(94,61,232,0.2); color:var(--accent); }
html[data-dark] #toolbarRight .share-section-btn { color:#c4b5fd; }
#toolbarRight .fav-section-btn { background:var(--fav-light); border-color:rgba(220,164,0,0.3); color:var(--fav); }
#toolbarRight .fav-section-btn.is-fav svg { fill:currentColor; }

/* favourites view */
.fav-empty { text-align:center; padding:3rem 1.5rem; color:var(--ink2); direction:ltr; }
.fav-empty svg { width:54px; height:54px; color:var(--fav); opacity:0.85; margin-bottom:0.6rem; }
.fav-empty h3 { font-size:1.2rem; font-weight:800; color:var(--ink); margin:0 0 0.4rem; }
.fav-empty p { font-size:0.95rem; max-width:380px; margin:0 auto; line-height:1.6; text-align:left; direction:ltr; unicode-bidi:plaintext; }
#resultsArea .fav-group, #resultsArea .fav-empty { direction:ltr; }
.fav-group { margin-bottom:1.6rem; }
.fav-group-title { font-size:max(12px,0.72rem); font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--fav); margin:0 0 0.7rem; }
.fav-sec-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:0.6rem; }
.fav-sec-card {
  position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:0.15rem;
  text-align:left; font-family:inherit; background:var(--surface);
  border:1px solid var(--border); border-radius:14px;
  padding:0.7rem 2.1rem 0.7rem 0.9rem; cursor:pointer; transition:all .15s;
}
.fav-sec-card:hover { border-color:var(--fav); box-shadow:var(--shadow); }
.fav-sec-he { font-size:1rem; font-weight:700; color:var(--ink); direction:rtl; }
.fav-sec-en { font-size:max(12px,0.72rem); font-weight:500; color:var(--ink2); direction:ltr; }
.fav-sec-remove, .fav-item-remove {
  position:absolute; top:6px; right:8px; width:22px; height:22px;
  display:flex; align-items:center; justify-content:center; border-radius:50%;
  color:var(--ink3); font-size:1.05rem; line-height:1; background:transparent;
  border:none; cursor:pointer; padding:0;
}
.fav-sec-remove:hover, .fav-item-remove:hover { background:var(--surface2); color:var(--ink); }
.fav-cards-block { margin-bottom:1.1rem; }
.fav-cards-secname { font-size:0.85rem; font-weight:700; color:var(--ink2); margin:0 0 0.45rem; }
.fav-secname-he { direction:rtl; font-weight:700; }
.fav-item {
  position:relative; display:flex; align-items:center; gap:0.55rem; width:100%;
  text-align:left; font-family:inherit; background:var(--surface);
  border:1px solid var(--border); border-radius:12px;
  padding:0.65rem 2.3rem 0.65rem 0.8rem; margin-bottom:0.4rem; cursor:pointer; transition:all .15s;
}
.fav-item:hover { border-color:var(--fav); box-shadow:var(--shadow); }
.fav-item-star { flex:0 0 auto; color:var(--fav); display:inline-flex; }
.fav-item-star svg { width:16px; height:16px; fill:currentColor; }
.fav-item-label { flex:1; font-size:0.92rem; color:var(--ink); line-height:1.35; min-width:0; direction:ltr; unicode-bidi:plaintext; }

.info-overlay {
  position:fixed; inset:0; z-index:3000;
  display:none; align-items:flex-start; justify-content:center;
  background:rgba(20,16,40,0.55); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  padding:max(2.5vh,18px) 16px; overflow-y:auto; -webkit-overflow-scrolling:touch;
}
.info-overlay.open { display:flex; animation:gsFade 0.2s ease; }
.info-card {
  background:var(--surface); color:var(--ink);
  border:1px solid var(--border); border-radius:20px;
  box-shadow:var(--shadow-lg);
  width:100%; max-width:620px; margin:auto;
  position:relative; overflow:hidden;
  display:flex; flex-direction:column; max-height:95vh;
}
.info-card-head {
  position:sticky; top:0; z-index:2;
  background:linear-gradient(160deg, var(--accent) 0%, var(--accent2) 100%);
  color:var(--on-accent); padding:1.5rem 1.4rem 1.25rem; text-align:center;
}
.info-card-head .info-logo {
  display:block; width:72px; height:72px; margin:0 auto 0.6rem;
  border-radius:18px; object-fit:cover;
  background:rgba(255,255,255,0.14);
  box-shadow:0 4px 14px rgba(0,0,0,0.18);
}
.info-card-head h2 { font-size:1.4rem; font-weight:800; margin:0; line-height:1.25; }
.info-card-head .info-tagline {
  font-size:0.92rem; font-weight:500; color:rgba(255,255,255,0.92);
  direction:ltr; margin-top:0.45rem; line-height:1.5;
}
.info-close {
  position:absolute; top:10px; left:10px;
  width:34px; height:34px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,0.22); color:#fff; border:none;
  font-size:1.3rem; line-height:1; cursor:pointer; transition:background 0.18s;
}
.info-close:hover { background:rgba(255,255,255,0.4); }
.info-body {
  padding:1.3rem 1.5rem 0.5rem; overflow-y:auto; -webkit-overflow-scrolling:touch;
  direction:ltr; text-align:left; line-height:1.62;
}
.info-body h3 {
  font-size:1.02rem; font-weight:800; color:var(--accent);
  margin:1.3rem 0 0.5rem;
}
.info-body h3:first-child { margin-top:0; }
.info-body p { font-size:0.95rem; color:var(--ink); margin:0 0 0.7rem; }
.info-body ul { margin:0 0 0.85rem; padding-left:1.15rem; }
.info-body li { font-size:0.93rem; color:var(--ink); margin-bottom:0.4rem; }
.info-body strong { font-weight:700; color:var(--ink); }
.info-body .info-he { direction:rtl; font-weight:700; }
.info-note {
  background:var(--accent-light); border:1px solid var(--accent-mid);
  border-radius:14px; padding:0.85rem 1rem; margin:0.4rem 0 0.9rem;
}
.info-note p:last-child { margin-bottom:0; }
.info-signoff {
  text-align:center; font-style:italic; color:var(--ink2);
  font-size:0.92rem; margin:1rem 0 0.4rem;
}
.info-card-foot {
  position:sticky; bottom:0; z-index:2;
  background:var(--surface); border-top:1px solid var(--border);
  padding:0.9rem 1.5rem calc(0.9rem + var(--sab));
  display:flex; justify-content:center;
}
.info-about-btn {
  display:block; width:100%; box-sizing:border-box; text-align:center;
  font-family:inherit; font-size:1rem; font-weight:700; color:var(--on-accent);
  background:var(--accent); border:none; border-radius:980px;
  padding:0.8rem 1.4rem; margin:0.3rem 0 0.4rem; cursor:pointer;
  box-shadow:0 2px 10px rgba(94,61,232,0.3); transition:transform .1s, opacity .18s;
}
.info-about-btn:hover { transform:translateY(-1px); opacity:0.94; }
.info-got-it {
  font-family:inherit; font-size:1rem; font-weight:700; color:var(--on-accent);
  background:var(--accent); border:none; border-radius:980px;
  padding:0.7rem 2.4rem; cursor:pointer; transition:opacity 0.18s, transform 0.1s;
  box-shadow:0 2px 10px rgba(94,61,232,0.3);
}
.info-got-it:hover { opacity:0.92; }
.info-got-it:active { transform:scale(0.97); }
/* Compact welcome modal */
.welcome-card { max-width:520px; }
.welcome-body { padding-top:1.4rem; padding-bottom:1.4rem; text-align:center; }
.welcome-example-btn { font-size:1.05rem; padding:0.9rem 1.4rem; margin:0 0 0.2rem; }
.welcome-guide-link {
  display:block; width:100%; box-sizing:border-box; text-align:center;
  font-family:inherit; font-size:0.92rem; font-weight:600; color:var(--accent);
  background:transparent; border:none; border-radius:980px;
  padding:0.55rem 1rem; margin:0.3rem 0 0.1rem; cursor:pointer;
  transition:opacity 0.18s;
}
.welcome-guide-link:hover { opacity:0.7; text-decoration:underline; }
.welcome-skip { text-align:center; margin:0.35rem 0 0; }
.welcome-skip a { font-size:0.86rem; color:var(--ink2); text-decoration:none; }
.welcome-skip a:hover { text-decoration:underline; }
@media (max-width:600px){
  .info-card { border-radius:16px; max-height:100%; }
  .info-card-head h2 { font-size:1.2rem; }
  .info-card-head .info-logo { width:60px; height:60px; border-radius:15px; }
  .info-card-head .info-tagline { font-size:0.86rem; }
  .info-body { padding:1.1rem 1.15rem 0.5rem; }
  .info-body h3 { font-size:0.98rem; }
}
/* What's New modal — reuses the .info-overlay / .info-card shell above */
.wn-block { border-top:1px solid var(--border); margin-top:1rem; padding-top:0.9rem; }
.wn-block:first-child { border-top:none; margin-top:0; padding-top:0; }
.wn-date { font-size:0.8rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--accent); margin:0 0 0.45rem; }
.wn-block ul { margin:0; padding-left:1.15rem; }
.wn-block li { font-size:0.95rem; color:var(--ink); margin-bottom:0.4rem; line-height:1.55; }

/* ===== LM source index ===== */
/* collapsible card sub-sections (model: SOC) */
.lm-sec{border-top:1px solid var(--border);}
.lm-sec{--sc:var(--accent);--scbg:var(--surface2);--scbgh:var(--border);}
.lm-sec-head{display:flex;align-items:center;gap:0.6rem;padding:0.7rem 1.2rem;cursor:pointer;user-select:none;background:var(--scbg);transition:background .15s;}
.lm-sec-head:hover{background:var(--scbgh);}
.lm-sec-title{flex:1;min-width:0;font-size:max(12px,0.72rem);font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:var(--sc);}
.lm-sec-count{font-size:max(12px,0.62rem);font-weight:700;color:var(--sc);background:var(--surface);border:1px solid var(--sc);border-radius:980px;padding:0.05rem 0.5rem;flex-shrink:0;opacity:0.9;}
.lm-sec-arrow{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%;flex-shrink:0;background:transparent;border:1.5px solid var(--sc);color:var(--sc);font-size:0.8rem;transition:transform .25s,background .15s,color .15s;}
.lm-sec.open .lm-sec-arrow{transform:rotate(180deg);background:var(--sc);color:var(--surface);border-color:var(--sc);}
/* per-section colours (light) */
.lm-sec.sec-halachos{--sc:#5e3de8;--scbg:rgba(94,61,232,0.07);--scbgh:rgba(94,61,232,0.14);}
.lm-sec.sec-sources{--sc:#0d9488;--scbg:rgba(13,148,136,0.08);--scbgh:rgba(13,148,136,0.16);}
.lm-sec.sec-topics{--sc:#0284c7;--scbg:rgba(2,132,199,0.08);--scbgh:rgba(2,132,199,0.16);}
.lm-sec.sec-eitzos{--sc:#1c8a2e;--scbg:rgba(28,138,46,0.08);--scbgh:rgba(28,138,46,0.16);}
.lm-sec.sec-sm{--sc:#5856d6;--scbg:rgba(88,86,214,0.08);--scbgh:rgba(88,86,214,0.16);}
.lm-sec.sec-cm{--sc:#c0392b;--scbg:rgba(192,57,43,0.08);--scbgh:rgba(192,57,43,0.16);}
.lm-sec.sec-parsha{--sc:#2d6a4f;--scbg:rgba(45,106,79,0.08);--scbgh:rgba(45,106,79,0.16);}
.lm-sec.sec-aos{--sc:#2563eb;--scbg:rgba(37,99,235,0.08);--scbgh:rgba(37,99,235,0.16);}
.lm-sec.sec-thk{--sc:#b8860b;--scbg:rgba(184,134,11,0.09);--scbgh:rgba(184,134,11,0.17);}
.lm-sec.sec-said{--sc:#7a3bc4;--scbg:rgba(122,59,196,0.08);--scbgh:rgba(122,59,196,0.16);}
.lm-sec.sec-lhsrc{--sc:#0e7490;--scbg:rgba(14,116,144,0.08);--scbgh:rgba(14,116,144,0.16);}
/* per-section colours (dark) */
html[data-dark] .lm-sec.sec-halachos{--sc:#a594f7;--scbg:rgba(124,95,232,0.18);--scbgh:rgba(124,95,232,0.28);}
html[data-dark] .lm-sec.sec-sources{--sc:#2dd4bf;--scbg:rgba(45,212,191,0.15);--scbgh:rgba(45,212,191,0.25);}
html[data-dark] .lm-sec.sec-topics{--sc:#38bdf8;--scbg:rgba(56,189,248,0.15);--scbgh:rgba(56,189,248,0.25);}
html[data-dark] .lm-sec.sec-eitzos{--sc:#5fd07e;--scbg:rgba(95,208,126,0.15);--scbgh:rgba(95,208,126,0.25);}
html[data-dark] .lm-sec.sec-sm{--sc:#9b99ee;--scbg:rgba(139,137,230,0.18);--scbgh:rgba(139,137,230,0.28);}
html[data-dark] .lm-sec.sec-cm{--sc:#f08a7e;--scbg:rgba(240,138,126,0.15);--scbgh:rgba(240,138,126,0.25);}
html[data-dark] .lm-sec.sec-parsha{--sc:#5fb98a;--scbg:rgba(95,185,138,0.15);--scbgh:rgba(95,185,138,0.25);}
html[data-dark] .lm-sec.sec-aos{--sc:#6fa3ff;--scbg:rgba(111,163,255,0.15);--scbgh:rgba(111,163,255,0.25);}
html[data-dark] .lm-sec.sec-thk{--sc:#e0b84a;--scbg:rgba(224,184,74,0.15);--scbgh:rgba(224,184,74,0.25);}
html[data-dark] .lm-sec.sec-said{--sc:#b69ae0;--scbg:rgba(182,154,224,0.15);--scbgh:rgba(182,154,224,0.25);}
html[data-dark] .lm-sec.sec-lhsrc{--sc:#22d3ee;--scbg:rgba(34,211,238,0.15);--scbgh:rgba(34,211,238,0.25);}
.lm-sec-body{display:none;}
.lm-sec.open>.lm-sec-body{display:block;}
.entry:not(.open) .lm-sec{display:none;}
@media (max-width:600px){.lm-sec-head{padding:0.6rem 0.85rem;}.lm-sec-title{font-size:max(12px,0.66rem);}}
.lm-sources{padding:0.3rem 1.2rem 0.5rem;}
.src-cat{display:flex;gap:0.5rem;align-items:flex-start;padding:0.3rem 0;border-top:1px solid var(--border);}
.src-cat:first-child{border-top:none;}
.src-cat-label{flex:0 0 6rem;font-size:max(12px,0.7rem);font-weight:700;color:var(--accent);line-height:1.5;padding-top:0.2rem;direction:rtl;text-align:right;}
.src-chips{flex:1 1 auto;display:flex;flex-wrap:wrap;gap:0.3rem;min-width:0;justify-content:flex-start;}
.source-chip{display:inline-flex;align-items:baseline;gap:0.3rem;padding:0.12rem 0.5rem;border-radius:980px;background:var(--surface2);border:1px solid var(--border);text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s;}
.source-chip:hover{background:var(--border);border-color:var(--accent);}
.source-chip .src-he{font-size:0.8rem;font-weight:600;color:var(--ink);direction:rtl;}
.source-chip .src-en{font-size:max(12px,0.66rem);font-weight:400;color:var(--ink2);direction:ltr;}
@media (max-width:600px){.src-cat-label{flex-basis:4.4rem;font-size:max(12px,0.64rem);}.source-chip{padding:0.1rem 0.42rem;}.source-chip .src-he{font-size:max(12px,0.74rem);}.source-chip .src-en{font-size:max(12px,0.6rem);}}

/* Sichos HaRan · mafteyach chips. Same chip as the LM/LH sources, but these are
   index headwords rather than links out, so they are buttons that run the entry
   as a search instead of anchors. The card body already carries its own side
   padding, so the block's own horizontal padding is removed here. */
.sch-mft .topics-label{padding-left:0;padding-right:0;}
.sch-mft .lm-sources{padding-left:0;padding-right:0;}
.mft-chip{cursor:pointer;}
.mft-chip:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
.mft-chip .mft-head{display:inline-flex;align-items:baseline;gap:0.3rem;min-width:0;}
/* An entry with a stated aspect gets the aspect underneath, in both languages,
   wrapping — these are whole phrases from the index, not labels, so they must be
   allowed to breathe. */
.mft-chip.mft-detail{flex-direction:column;align-items:flex-end;white-space:normal;
  max-width:30rem;padding:0.26rem 0.62rem;gap:0.12rem;}
.mft-chip .mft-sub{display:flex;flex-direction:column;align-items:flex-end;gap:0.02rem;
  padding-top:0.1rem;border-top:1px solid var(--border);width:100%;}
.mft-chip .mft-sub-he{font-size:max(12px,0.68rem);font-weight:500;color:var(--ink2);direction:rtl;
  text-align:right;line-height:1.45;}
.mft-chip .mft-sub-en{font-size:max(12px,0.64rem);font-weight:400;color:var(--ink3);direction:ltr;
  text-align:left;line-height:1.4;align-self:flex-start;}
@media (max-width:600px){
  .mft-chip.mft-detail{max-width:100%;}
  .mft-chip .mft-sub-he{font-size:max(12px,0.63rem);}
  .mft-chip .mft-sub-en{font-size:max(12px,0.6rem);}
}

/* ── EDGE-TO-EDGE SAFE AREA (Android + the iOS app / installed PWA) ───────
   Android 15 (and the Play-Store app, which targets SDK 35) draws the WebView
   under the status bar and the navigation bar. Without this the sticky search
   bar sat beneath the clock / wifi icons and its buttons could not be tapped.
   The iOS App Store build (Capacitor WKWebView) fills the whole screen in the
   same way, so the title ran up under the notch / selfie camera.
   The head script adds .safe-top + viewport-fit=cover on Android, and on iOS
   only inside the app shell / home-screen PWA (never an ordinary Safari tab,
   which already keeps the page clear), so the env(safe-area-inset-*) values are
   reported; here we inset the page by them. */
:root { --sat:env(safe-area-inset-top,0px); --sab:env(safe-area-inset-bottom,0px); }
html.safe-top body { padding-top:var(--sat); padding-bottom:var(--sab); }
html.safe-top .search-bar { top:var(--sat); }
/* Frosted strip behind the status bar, so content scrolls *under* it cleanly */
#safeTopCover {
  display:none; position:fixed; top:0; left:0; right:0; height:var(--sat,0px); z-index:250;
  background:rgba(242,242,247,0.88);
  backdrop-filter:saturate(180%) blur(20px); -webkit-backdrop-filter:saturate(180%) blur(20px);
  pointer-events:none;
}
html.safe-top #safeTopCover { display:block; }
html[data-dark] #safeTopCover { background:rgba(28,28,30,0.94); }
/* Keep the floating buttons clear of the gesture / 3-button navigation bar */
html.safe-top #scrollTopBtn { bottom:calc(1.5rem + var(--sab)); }
html.safe-top #mnBackBtn,
html.safe-top #aboutBackBtn,
html.safe-top #refBackBtn { bottom:calc(4.75rem + var(--sab)); }



#aboutPanel{display:none;}
.about-toggle-btn{color:var(--accent)!important;border:1.5px solid var(--accent-mid)!important;font-weight:700!important;}
.about-toggle-btn.active{background:var(--accent)!important;color:var(--on-accent)!important;border-color:var(--accent)!important;}
.about-ss-card .ss-en{color:var(--accent);font-weight:600;}
.ab-wrap{max-width:760px;margin:0 auto;padding:2.2rem 1.25rem 5rem;color:var(--ink);font-family:var(--font-ui);text-align:left;direction:ltr;}
.ab-eyebrow{display:inline-block;font-size:max(12px,0.72rem);font-weight:700;letter-spacing:0.12em;text-transform:uppercase;color:var(--accent);background:var(--accent-light);border:1px solid var(--accent-mid);padding:0.3rem 0.8rem;border-radius:980px;margin-bottom:1.1rem;}
.ab-title{font-size:2.4rem;line-height:1.15;font-weight:900;margin:0 0 0.5rem;letter-spacing:-0.01em;}
.ab-title .he{display:block;font-size:1.5rem;font-weight:700;color:var(--accent);margin-top:0.4rem;direction:rtl;}
.ab-lede{font-size:1.18rem;line-height:1.75;color:var(--ink2);margin:0 0 2.2rem;}
.ab-toc{display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center;margin:0 0 2.8rem;padding:1.1rem 1.2rem;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);}
.ab-toc-title{width:100%;font-size:max(12px,0.72rem);font-weight:700;letter-spacing:0.09em;text-transform:uppercase;color:var(--ink3);margin-bottom:0.15rem;}
.ab-toc a{font-size:0.88rem;color:var(--accent);background:var(--accent-light);border:1px solid var(--accent-mid);border-radius:980px;padding:0.32rem 0.8rem;cursor:pointer;text-decoration:none;transition:background .15s;}
.ab-toc a:hover{background:var(--accent-mid);}
.ab-sec{margin:0 0 2.8rem;scroll-margin-top:24px;}
.ab-sec h2{font-size:1.55rem;font-weight:800;margin:0 0 1rem;padding-bottom:0.55rem;border-bottom:2px solid var(--border);}
.ab-sec h3{font-size:1.1rem;font-weight:700;color:var(--accent);margin:1.7rem 0 0.5rem;}
.ab-sec p{font-size:1.07rem;line-height:1.9;margin:0 0 1.1rem;color:var(--ink);}
.ab-sec p em{color:var(--ink2);}
.ab-he{font-weight:700;}
.ab-link{color:var(--accent);font-weight:600;cursor:pointer;text-decoration:none;border-bottom:1.5px solid var(--accent-mid);transition:border-color .15s,background .15s;border-radius:2px;padding:0 1px;}
.ab-link:hover{border-bottom-color:var(--accent);background:var(--accent-light);}
.ab-pills{display:flex;flex-wrap:wrap;gap:0.55rem;margin:1.3rem 0 0.3rem;}
.ab-pill{font-family:inherit;font-size:0.92rem;font-weight:600;color:var(--accent);background:var(--surface);border:1px solid var(--accent-mid);border-radius:980px;padding:0.5rem 1rem;cursor:pointer;transition:all .15s;box-shadow:var(--shadow-sm);}
.ab-pill:hover{background:var(--accent);color:var(--on-accent);border-color:var(--accent);}
.ab-callout{background:var(--accent-light);border:1px solid var(--accent-mid);border-left:4px solid var(--accent);border-radius:var(--radius);padding:1.1rem 1.3rem;margin:1.5rem 0;}
.ab-callout p{margin:0;font-size:1.02rem;line-height:1.75;color:var(--ink);}
.ab-note{font-size:0.88rem;color:var(--ink3);line-height:1.7;border-top:1px solid var(--border);margin-top:2.2rem;padding-top:1.3rem;}
#aboutBackBtn{position:fixed;bottom:4.75rem;right:1.5rem;z-index:300;display:flex;align-items:center;gap:0.35rem;background:var(--surface);color:var(--accent);border:1.5px solid var(--accent-mid);border-radius:980px;padding:0.5rem 0.95rem;font-family:var(--font-ui);font-size:0.85rem;font-weight:700;cursor:pointer;box-shadow:var(--shadow-md);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s,transform .2s;}
#aboutBackBtn.show{opacity:1;transform:none;pointer-events:auto;}
#aboutBackBtn:hover{background:var(--accent);color:var(--on-accent);border-color:var(--accent);}
/* Universal back button for internal cross-link jumps (mirrors #aboutBackBtn, bottom-left) */
#refBackBtn{position:fixed;bottom:4.75rem;left:1.5rem;z-index:300;display:flex;align-items:center;gap:0.35rem;background:var(--surface);color:var(--accent);border:1.5px solid var(--accent-mid);border-radius:980px;padding:0.5rem 0.95rem;font-family:var(--font-ui);font-size:0.85rem;font-weight:700;cursor:pointer;box-shadow:var(--shadow-md);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .2s,transform .2s;}
#refBackBtn.show{opacity:1;transform:none;pointer-events:auto;}
#refBackBtn:hover{background:var(--accent);color:var(--on-accent);border-color:var(--accent);}
@media(max-width:600px){.ab-title{font-size:1.9rem;}.ab-title .he{font-size:1.3rem;}.ab-lede{font-size:1.07rem;}.ab-sec p{font-size:1.02rem;line-height:1.85;}.ab-sec h2{font-size:1.35rem;}.ab-wrap{padding:1.5rem 1rem 4rem;}}


/* ── GET-THE-APP BAR ─────────────────────────────────────────────
   A slim strip that slides up at the foot of the screen when the website is
   opened in a phone browser, pointing iPhone readers to the App Store and
   Android readers to Google Play. It never appears inside the installed app
   itself, inside a home-screen PWA, or on a desktop. */
#appBar{
  position:fixed; left:0; right:0; bottom:0; z-index:2400;
  display:none; align-items:center; gap:0.7rem;
  direction:ltr; text-align:left;
  padding:0.6rem 0.85rem calc(0.6rem + var(--sab));
  background:rgba(255,255,255,0.93);
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  border-top:1px solid var(--border);
  box-shadow:0 -6px 24px rgba(0,0,0,0.10);
  transform:translateY(115%);
  transition:transform 0.34s cubic-bezier(0.22,0.9,0.3,1);
  font-family:var(--font-ui);
}
#appBar.show{ transform:none; }
html[data-dark] #appBar{ background:rgba(28,28,30,0.95); box-shadow:0 -6px 24px rgba(0,0,0,0.45); }
#appBar .ab-icon{ width:2.6rem; height:2.6rem; border-radius:12px; flex:0 0 auto; object-fit:cover; box-shadow:var(--shadow-sm); }
#appBar .ab-text{ flex:1 1 auto; min-width:0; text-align:left; direction:ltr; }
#appBar .ab-t{ font-size:0.9rem; font-weight:800; color:var(--ink); line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#appBar .ab-s{ font-size:0.76rem; color:var(--ink2); line-height:1.35; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#appBar .ab-get{
  flex:0 0 auto; font-family:inherit; font-size:0.82rem; font-weight:700;
  color:var(--on-accent); background:var(--accent); border:none; border-radius:980px;
  padding:0.46rem 1.05rem; cursor:pointer; text-decoration:none; white-space:nowrap;
  box-shadow:0 2px 8px rgba(94,61,232,0.32);
}
#appBar .ab-get:hover{ background:var(--accent2); }
#appBar .ab-x{
  flex:0 0 auto; width:1.75rem; height:1.75rem; border-radius:50%;
  border:none; background:transparent; color:var(--ink3);
  font-size:1.15rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
#appBar .ab-x:hover{ background:var(--surface3); color:var(--ink2); }
/* Give the page a little room so the bar never covers the last line of a card,
   and lift the floating round buttons clear of it while it is up. */
html.appbar-on body{ padding-bottom:calc(4.2rem + var(--sab)); }
html.appbar-on #scrollTopBtn{ bottom:calc(1.5rem + 3.9rem + var(--sab)); }
html.appbar-on #mnBackBtn,
html.appbar-on #aboutBackBtn,
html.appbar-on #refBackBtn{ bottom:calc(4.75rem + 3.9rem + var(--sab)); }
@media(max-width:340px){ #appBar .ab-s{ display:none; } }

/* The same two links, quietly, inside the info guide — mainly for desktop readers */
.info-apps{ display:flex; flex-wrap:wrap; gap:0.6rem; margin:0.9rem 0 0.2rem; }
.info-app-link{
  display:inline-flex; align-items:center; gap:0.4rem;
  font-family:inherit; font-size:0.9rem; font-weight:600;
  color:var(--accent); background:var(--accent-light);
  border:1px solid var(--accent-mid); border-radius:980px;
  padding:0.45rem 1rem; text-decoration:none; transition:background 0.15s,color 0.15s;
}
.info-app-link:hover{ background:var(--accent); color:var(--on-accent); }


/* ══════════════════════════════════════════════════════════════════════════
   OTZAR v2 DESIGN LAYER (Dev Pack v2, October 2026)
   One purple accent, calm type, slim header, three-column layout.
   Sits LAST in the cascade so it re-points the older variables at the new
   tokens without touching the 3,000 lines of section CSS above it.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Fonts: self-hosted (filtered phones often block Google Fonts) ──────────
   'Otzar UI' and 'Otzar Display' are composite families: every Hebrew code point
   is drawn by Frank Ruhl Libre, every Latin one by Inter / Cormorant Garamond.
   So mixed lines need no per-span tagging — Hebrew always lands in Frank Ruhl. */

/* Hebrew half (Frank Ruhl Libre, slightly enlarged so it sits level with Latin) */
/* Latin half (Inter) */
/* Display: Frank Ruhl for Hebrew, Cormorant Garamond for English headings */

/* ── Tokens (light) ──────────────────────────────────────────────────────── */
:root{
  --bg:#faf7f2; --surface:#ffffff; --surface-2:#f3efe7; --surface-3:#ebe5da;
  --ink:#1d1b18; --ink-2:#5f5a52; --ink-3:#6e6961;
  --line:rgba(29,27,24,.08); --line-2:rgba(29,27,24,.14);
  --accent:#5e3de8; --accent-hover:#4c2dd0; --accent-ink:#4527b8;
  --accent-soft:#f1edfd; --accent-mid-2:#e3dbfb; --on-accent:#ffffff;

  --font-ui:'Otzar UI','Inter','Frank Ruhl Libre',-apple-system,system-ui,'Segoe UI',sans-serif;
  --font-display:'Otzar Display','Cormorant Garamond','Frank Ruhl Libre',Georgia,serif;
  --font-he:'Frank Ruhl Libre','Noto Serif Hebrew',serif;

  --r-card:14px; --r-sm:10px; --r-pill:999px;
  --shadow-1:0 1px 2px rgba(29,27,24,.05),0 1px 3px rgba(29,27,24,.05);
  --shadow-2:0 10px 30px rgba(29,27,24,.10),0 2px 6px rgba(29,27,24,.06);
  --header-h:64px; --gap:12px; --sat-eff:0px;
  --ease:cubic-bezier(.2,.8,.2,1); --t-fast:150ms; --t-med:200ms; --t-sheet:250ms;

  /* the older variable names, re-pointed at the tokens */
  --surface2:var(--surface-2); --surface3:var(--surface-3);
  --ink2:var(--ink-2); --ink3:var(--ink-3);
  --border:var(--line);
  --accent2:var(--accent-hover);
  --accent-light:var(--accent-soft); --accent-mid:var(--accent-mid-2);
  --radius:var(--r-card);
  --shadow-sm:var(--shadow-1); --shadow-md:var(--shadow-2); --shadow-lg:var(--shadow-2);

  /* every section accent becomes the one purple; the old hues survive only as
     --tint-* for the thin 3px marker on that section's cards */
  --tint-aos:#5e3de8; --tint-his:#0f8a78; --tint-shtz:#a9791b; --tint-kab:#2456c9; --tint-mn:#c2456e;
  --tint-cn:#c2410c; --tint-yh:#047857; --tint-mb:#3f6b8c; --tint-sim:#c77a12; --tint-pw:#0e7490;
  --tint-tc:#3b3d8c; --tint-ym:#8a3b52; --tint-gc:#0e7490; --tint-lib:#6b4423; --tint-str:#8b4513;
  --tint-soc:#7c5200; --tint-oc:#0071e3; --tint-yd:#1c8a2e; --tint-cm:#7a3bc4; --tint-ae:#bf4800;
  --aos:var(--accent); --aos2:var(--accent-hover); --aos-light:var(--accent-soft); --aos-mid:var(--accent-mid-2);
  --soc:var(--accent); --soc2:var(--accent-hover); --soc-light:var(--accent-soft); --soc-mid:var(--accent-mid-2); --soc-border:var(--line-2);
  --str:var(--accent); --str2:var(--accent-hover); --str-light:var(--accent-soft); --str-mid:var(--accent-mid-2);
  --his:var(--accent); --his2:var(--accent-hover); --his-light:var(--accent-soft); --his-mid:var(--accent-mid-2);
  --shtz:var(--accent); --shtz2:var(--accent-hover); --shtz-light:var(--accent-soft); --shtz-mid:var(--accent-mid-2);
  --kab:var(--accent); --kab2:var(--accent-hover); --kab-light:var(--accent-soft); --kab-mid:var(--accent-mid-2);
  --mn:var(--accent); --mn2:var(--accent-hover); --mn-light:var(--accent-soft); --mn-mid:var(--accent-mid-2);
  --cn:var(--accent); --cn2:var(--accent-hover); --cn-light:var(--accent-soft); --cn-mid:var(--accent-mid-2);
  --yh:var(--accent); --yh2:var(--accent-hover); --yh-light:var(--accent-soft); --yh-mid:var(--accent-mid-2);
  --mb:var(--accent); --mb2:var(--accent-hover); --mb-light:var(--accent-soft); --mb-mid:var(--accent-mid-2);
  --sim:var(--accent); --sim2:var(--accent-hover); --sim-light:var(--accent-soft); --sim-mid:var(--accent-mid-2);
  --pw:var(--accent); --pw2:var(--accent-hover); --pw-light:var(--accent-soft); --pw-mid:var(--accent-mid-2);
  --tc:var(--accent); --tc2:var(--accent-hover); --tc-light:var(--accent-soft); --tc-mid:var(--accent-mid-2); --tc-fill:var(--accent-soft); --tc-line:var(--accent-mid-2);
  --ym:var(--accent); --ym2:var(--accent-hover); --ym-light:var(--accent-soft); --ym-mid:var(--accent-mid-2);
  --gc:var(--accent); --gc2:var(--accent-hover); --gc-light:var(--accent-soft); --gc-mid:var(--accent-mid-2);
  --lib:var(--accent); --lib2:var(--accent-hover); --lib-light:var(--accent-soft); --lib-mid:var(--accent-mid-2);
  --oc:var(--accent); --yd:var(--accent); --cm:var(--accent); --ae:var(--accent); --hk:var(--ink-2);
}
@media (max-width:599px){ :root{ --header-h:56px; } }
html.safe-top{ --sat-eff:var(--sat,0px); }

/* ── Tokens (dark) — the moon button sets html[data-dark]; with no stored
      choice the head script follows the phone's own setting ── */
html[data-dark]{
  /* Round 2 (R1): Yehuda chose "soft graphite" (14 Oct 2026) — a warm dark grey,
     lighter than the brief's palette, with the purple kept for buttons and links */
  --bg:#303034;
  --surface:#3d3d43; --surface-2:#46464d; --surface-3:#505058;
  --ink:#f5f5f7; --ink-2:#d6d6db; --ink-3:#bcbcc4;
  --line:rgba(255,255,255,.14);
  --line-2:rgba(255,255,255,.22);
  --accent:#b6a7ff; --accent-hover:#c4b8ff;
  --accent-ink:#c8bcff; --accent-soft:#3f3a58;
  --accent-mid-2:#4f4875; --on-accent:#17161c;
  --accent-fill:#5e47d6; --accent-fill-hover:#6a55e0;
  --on-accent-fill:#ffffff;
  --shadow-1:0 1px 2px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);
  --shadow-2:0 10px 30px rgba(0,0,0,.45),0 2px 6px rgba(0,0,0,.3);
  --tint-his:#19b89f; --tint-shtz:#d4a843; --tint-kab:#5b8def; --tint-mn:#e785a4; --tint-cn:#f57a3c;
  --tint-yh:#34d399; --tint-mb:#7fb0d4; --tint-sim:#f0ab4e; --tint-pw:#38bdf8; --tint-tc:#8f93e6;
  --tint-ym:#d98aa3; --tint-gc:#38bdf8; --tint-lib:#c9a27a; --tint-str:#d49a6a; --tint-aos:#9d88ff;
  --aos:var(--accent); --his:var(--accent); --shtz:var(--accent); --kab:var(--accent); --mn:var(--accent);
  --cn:var(--accent); --yh:var(--accent); --mb:var(--accent); --sim:var(--accent); --pw:var(--accent);
  --tc:var(--accent); --ym:var(--accent); --gc:var(--accent); --lib:var(--accent); --str:var(--accent); --soc:var(--accent);
  --fav:#f0c64b;
  --aos-light:var(--accent-soft); --aos-mid:var(--accent-mid-2);
  --his-light:var(--accent-soft); --his-mid:var(--accent-mid-2); --shtz-light:var(--accent-soft); --shtz-mid:var(--accent-mid-2);
  --kab-light:var(--accent-soft); --kab-mid:var(--accent-mid-2); --mn-light:var(--accent-soft); --mn-mid:var(--accent-mid-2);
  --cn-light:var(--accent-soft); --cn-mid:var(--accent-mid-2); --yh-light:var(--accent-soft); --yh-mid:var(--accent-mid-2);
  --mb-light:var(--accent-soft); --mb-mid:var(--accent-mid-2); --sim-light:var(--accent-soft); --sim-mid:var(--accent-mid-2);
  --pw-light:var(--accent-soft); --pw-mid:var(--accent-mid-2); --tc-light:var(--accent-soft); --tc-mid:var(--accent-mid-2);
  --ym-light:var(--accent-soft); --ym-mid:var(--accent-mid-2); --gc-light:var(--accent-soft); --gc-mid:var(--accent-mid-2);
  --lib-light:var(--accent-soft); --lib-mid:var(--accent-mid-2); --str-light:var(--accent-soft); --str-mid:var(--accent-mid-2);
  --soc-light:var(--accent-soft); --soc-mid:var(--accent-mid-2);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
body{ font-family:var(--font-ui); background:var(--bg); color:var(--ink); line-height:1.5; }
button, input, select, textarea{ font-family:inherit; }
a, .link{ color:var(--accent-ink); }
:focus-visible{ outline:3px solid var(--accent-mid-2); outline-offset:2px; }
html[data-dark] :focus-visible{ outline-color:var(--accent); }
[lang="he"], .he{ font-family:var(--font-ui); unicode-bidi:isolate; }
.he{ direction:rtl; }

/* The old furniture this design replaces. Kept in the DOM (code still toggles
   them) but never shown. */
.hero, .mobile-nav, #globalSearchBtn, #darkToggleBtn, #favNavBtn, #infoBtn,
#scrollTopBtn, #sectionSheetOverlay, #welcomeOverlay, .search-scope-all,
.search-scope-row .inspire-btn, #searchKbHint, .mobile-menu, .mobile-menu-backdrop{ display:none !important; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header{
  position:sticky; top:var(--sat-eff); z-index:300; height:var(--header-h);
  display:flex; align-items:center; gap:16px; padding:0 24px;
  direction:ltr; text-align:left;
  background:color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter:saturate(1.4) blur(12px); backdrop-filter:saturate(1.4) blur(12px);
  border-bottom:1px solid var(--line);
  transition:box-shadow var(--t-med) var(--ease);
}
.site-header.is-scrolled{ box-shadow:0 1px 0 var(--line),0 6px 20px rgba(29,27,24,.06); }
.wm{ display:flex; align-items:center; gap:8px; white-space:nowrap; color:var(--accent); text-decoration:none; min-width:0; }
.wm-logo{ width:34px; height:34px; border-radius:9px; flex:none; box-shadow:var(--shadow-1); }
.wm-text{ display:flex; align-items:baseline; gap:8px; min-width:0; }
.wm-en{ font-family:var(--font-display); font-weight:700; font-size:24px; line-height:1; }
.wm-dot{ color:var(--ink-3); font-size:16px; }
.wm-he{ font-family:var(--font-he); font-weight:600; font-size:21px; line-height:1; direction:rtl; unicode-bidi:isolate; }
.header-search{
  flex:1; max-width:520px; height:40px; margin-left:16px;
  display:flex; align-items:center; gap:10px; padding:0 14px;
  border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface);
  color:var(--ink-3); font:inherit; font-size:14px; box-shadow:var(--shadow-1); cursor:text; text-align:left;
}
.header-search:hover{ border-color:var(--accent-mid-2); }
.header-search .hs-text{ flex:1; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.header-icons{ display:flex; align-items:center; gap:4px; margin-left:auto; }
.icon-btn{
  position:relative; min-width:44px; height:44px; padding:0 10px; border-radius:var(--r-pill);
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  border:0; background:transparent; color:var(--ink-2); cursor:pointer; font:inherit; font-size:14px; font-weight:500;
  transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover{ background:var(--surface-2); color:var(--ink); }
.icon-btn.is-on{ color:var(--accent); background:var(--accent-soft); }
.icon-btn svg{ width:20px; height:20px; flex:none; }
.icon-btn .hi-label{ font-size:14px; }
.fav-count{ position:absolute; top:5px; right:3px; min-width:17px; height:17px; padding:0 4px; border-radius:9px;
  background:var(--accent); color:var(--on-accent); font-size:12px; font-weight:700; line-height:17px; text-align:center; display:none; }
.fav-count.has{ display:block; }
.ic-sun{ display:none; } html[data-dark] .ic-sun{ display:block; } html[data-dark] .ic-moon{ display:none; }
.section-picker{
  display:none; align-items:center; gap:8px; height:40px; padding:0 12px 0 16px; max-width:340px;
  border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface);
  font:inherit; font-size:14px; font-weight:600; color:var(--ink); box-shadow:var(--shadow-1); cursor:pointer; white-space:nowrap;
}
.section-picker .sp-he{ font-weight:500; color:var(--ink-2); font-size:15px; direction:rtl; unicode-bidi:isolate; }
.section-picker svg{ flex:none; color:var(--ink-3); }
.hi-menu{ display:none; }
@media (max-width:1199px){ .section-picker{ display:inline-flex; } }
@media (max-width:1099px){
  .header-search{ flex:0 0 44px; width:44px; padding:0; justify-content:center; border:0; box-shadow:none; background:transparent; margin-left:auto; }
  .header-search .hs-text{ display:none; }
  .header-icons{ margin-left:0; }
  .hi-inspire .hi-label{ display:none; }
}
@media (max-width:599px){
  .site-header{ padding:0 6px 0 12px; gap:4px; }
  .wm-logo{ width:30px; height:30px; border-radius:8px; }
  .wm-en{ font-size:20px; } .wm-he{ font-size:17.5px; } .wm-dot{ font-size:13px; }
  .section-picker{ display:none; }
  .header-icons .icon-btn:not(.keep-phone){ display:none; }
  .hi-menu{ display:inline-flex; }
}
@media (max-width:359px){ .wm-logo{ display:none; } }

/* ── Layout: three columns from 1200px, two from 900px, one below ─────── */
.layout{
  display:grid; grid-template-columns:248px minmax(0,1fr) 312px; gap:32px;
  max-width:1392px; margin:0 auto; padding:24px 24px 64px; direction:ltr; align-items:start;
}
.content{ direction:rtl; min-width:0; }
.rail-left, .rail-right{
  position:sticky; top:calc(var(--sat-eff) + var(--header-h) + 24px); align-self:start;
  max-height:calc(100vh - var(--header-h) - var(--sat-eff) - 32px); overflow:auto; overscroll-behavior:contain; scrollbar-width:thin;
  direction:ltr; text-align:left;
}
.rail-right{ display:flex; flex-direction:column; gap:16px; }
.rail-left .nav-group{ margin-bottom:14px; }
.rail-left .nav-label, .sp-label, .v2-label{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); padding:0 12px 6px; }
.rail-left .nav-item{
  display:flex; justify-content:space-between; align-items:center; gap:10px; min-height:34px; padding:0 12px;
  border-radius:var(--r-sm); font-size:14px; font-weight:500; color:var(--ink-2); cursor:pointer; border:0; background:none; width:100%; text-align:left; font-family:inherit;
  transition:background var(--t-fast) var(--ease);
}
.rail-left .nav-item:hover{ background:var(--surface-2); color:var(--ink); }
.rail-left .nav-item.is-on{ background:var(--accent-soft); color:var(--accent-ink); font-weight:600; }
.rail-left .nav-item .he, .sp-item .he{ font-size:14px; color:var(--ink-3); }
.rail-left .nav-item.is-on .he{ color:var(--accent-ink); }
@media (max-width:1199px){
  .layout{ grid-template-columns:minmax(0,1fr) 280px; gap:24px; padding:16px 24px 48px; }
  .rail-left{ display:none; }
}
@media (max-width:899px){
  .layout{ grid-template-columns:minmax(0,1fr); gap:12px; padding:12px 16px 40px; }
  .rail-right{ position:static; max-height:none; overflow:visible; order:-1; }
  .rail-right .newhere-card{ display:none; }
}

/* ── Section head (title above the toolbar) ──────────────────────────── */
.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; direction:ltr; padding:4px 2px 14px; }
.section-head .sh-kicker{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); margin-bottom:4px; }
.section-head .sh-title{ font-family:var(--font-display); font-weight:700; font-size:38px; line-height:1.1; color:var(--ink); margin:0; }
.section-head .sh-he{ font-family:var(--font-he); font-weight:600; font-size:30px; line-height:1.1; color:var(--ink); direction:rtl; text-align:right; }
.section-head .sh-pill{ display:inline-flex; align-items:center; gap:6px; margin-top:8px; font-size:13px; font-weight:600; color:var(--accent-ink); background:var(--accent-soft); border:0; border-radius:var(--r-pill); padding:6px 12px; cursor:pointer; font-family:inherit; }
@media (max-width:1199px){ .section-head .sh-title{ font-size:32px; } .section-head .sh-he{ font-size:26px; } }
@media (max-width:599px){ .section-head{ padding:4px 2px 8px; } .section-head .sh-title{ font-size:28px; } .section-head .sh-he{ font-size:24px; } }
.phone-picker{ display:none; width:100%; height:44px; margin:0 0 12px; justify-content:space-between; padding:0 14px 0 16px; direction:ltr; }
@media (max-width:599px){ .phone-picker{ display:flex; max-width:none; } }

/* ── Section toolbar (the old sticky search block, now slim) ─────────── */
.search-bar{
  position:sticky; top:calc(var(--sat-eff) + var(--header-h)); z-index:200;
  background:var(--bg); -webkit-backdrop-filter:none; backdrop-filter:none;
  border:0; padding:6px 0 10px; margin:0 0 4px;
  transition:padding var(--t-med) var(--ease);
}
html.safe-top .search-bar{ top:calc(var(--sat-eff) + var(--header-h)); }
html[data-dark] .search-bar{ background:var(--bg); }
.search-bar .search-inner{ max-width:none; margin:0; padding:0; }
.search-bar .search-input-wrap{ max-width:none; }
.search-bar .search-inner input, #searchInput{
  height:40px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface);
  box-shadow:var(--shadow-1); font-family:var(--font-ui); color:var(--ink);
}
.search-bar .filters-body, .search-bar #searchToolbar, .search-bar .filters-toggle, .search-bar .search-scope-row{
  transition:opacity var(--t-med) var(--ease), max-height var(--t-med) var(--ease);
}
@media (min-width:600px){
  .is-scrolled-page .search-bar{ padding:4px 0; box-shadow:0 1px 0 var(--line); }
  .is-scrolled-page .search-bar .search-scope-row,
  .is-scrolled-page .search-bar .filters-toggle,
  .is-scrolled-page .search-bar .filters-body,
  .is-scrolled-page .search-bar #searchToolbar{ opacity:0; max-height:0; overflow:hidden; pointer-events:none; margin:0; padding-top:0; padding-bottom:0; }
}
@media (max-width:599px){ .search-bar{ position:relative; top:auto; } }
.search-scope-row{ min-height:0; }
.search-scope-row:not(:has(.offline-pill.show)) .fs-ctrl{ margin-inline-start:auto; }

/* ── Cards ───────────────────────────────────────────────────────────── */
#resultsArea .entry, #resultsArea .lh-entry, #resultsArea .parsha-entry, #resultsArea .lt-entry,
#resultsArea .halacha-block, #resultsArea .aos-entry, #resultsArea .his-entry, #resultsArea .shtz-entry,
#resultsArea .cn-entry, #resultsArea .yh-entry, #resultsArea .mb-entry, #resultsArea .gc-entry, #resultsArea .lib-entry,
.inspire-card .entry{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); box-shadow:var(--shadow-1);
  margin-bottom:var(--gap);
  transition:box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
@media (hover:hover){
  #resultsArea .entry:not(.open):hover, #resultsArea .lh-entry:not(.open):hover, #resultsArea .lt-entry:not(.open):hover,
  #resultsArea .parsha-entry:not(.open):hover, #resultsArea .his-entry:not(.open):hover, #resultsArea .aos-entry:not(.open):hover{
    box-shadow:var(--shadow-2); transform:translateY(-1px); border-color:var(--line-2);
  }
  #resultsArea .entry:hover .entry-title{ color:var(--accent-ink); }
}
/* first-load / big-list speed: the browser skips laying out off-screen cards. Any jump to a
   card (deep link, cross-reference, Back, Inspire) switches this off first (html.cv-off) so the
   card's position is exact; a manual section switch turns it back on. */
html:not(.cv-off) #resultsArea > .entry:not(.open), html:not(.cv-off) #resultsArea > .lh-entry:not(.open), html:not(.cv-off) #resultsArea > .lt-entry:not(.open),
html:not(.cv-off) #resultsArea > .parsha-entry:not(.open), html:not(.cv-off) #resultsArea > .his-entry:not(.open){ content-visibility:auto; contain-intrinsic-size:auto 150px; }
/* the per-section colour now lives only in a thin marker on that section's cards */
html[data-mode] #resultsArea > [class*="entry"]{ border-left:3px solid var(--sec-tint, var(--line)); }
html[data-mode="lm"] #resultsArea > [class*="entry"], html[data-mode="fav"] #resultsArea > [class*="entry"]{ border-left-width:1px; border-left-color:var(--line); }
html[data-mode="aos"]{--sec-tint:var(--tint-aos)} html[data-mode="his"]{--sec-tint:var(--tint-his)} html[data-mode="shtz"]{--sec-tint:var(--tint-shtz)}
html[data-mode="kab"]{--sec-tint:var(--tint-kab)} html[data-mode="mn"]{--sec-tint:var(--tint-mn)} html[data-mode="cn"]{--sec-tint:var(--tint-cn)}
html[data-mode="sim"]{--sec-tint:var(--tint-sim)} html[data-mode="pw"]{--sec-tint:var(--tint-pw)} html[data-mode="tc"]{--sec-tint:var(--tint-tc)}
html[data-mode="ym"]{--sec-tint:var(--tint-ym)} html[data-mode="gc"]{--sec-tint:var(--tint-gc)} html[data-mode="lib"]{--sec-tint:var(--tint-lib)}
html[data-mode="str"]{--sec-tint:var(--tint-str)} html[data-mode="lh"]{--sec-tint:var(--tint-oc)} html[data-mode="lt"]{--sec-tint:var(--tint-cm)}
html[data-mode="le"]{--sec-tint:var(--tint-yd)} html[data-mode="ps"]{--sec-tint:var(--tint-yd)} html[data-mode="al"]{--sec-tint:var(--tint-soc)}
html[data-mode="cm"]{--sec-tint:var(--tint-ae)} html[data-mode="shr"]{--sec-tint:var(--tint-ae)} html[data-mode="sch"]{--sec-tint:var(--tint-soc)}
html[data-mode="shm"]{--sec-tint:var(--tint-shtz)} html[data-mode="sm"]{--sec-tint:var(--tint-cm)} html[data-mode="thk"]{--sec-tint:var(--tint-tc)}

/* tap targets: 44×44 hit areas, grown with padding, never by enlarging the icon */
.fav-star, .share-btn, .fs-btn, .info-close, .kabbook-close, .section-sheet-close, .resume-x,
.card-toggle-arrow{ min-width:44px; min-height:44px; display:inline-grid; place-items:center; }
.card-toggle-arrow{ width:44px; height:44px; background:transparent !important; border:0 !important; color:var(--ink-3); }
.entry.open .card-toggle-arrow, .lh-entry.open .card-toggle-arrow, .parsha-entry.open .card-toggle-arrow,
.lt-entry.open .card-toggle-arrow, .halacha-block.open .card-toggle-arrow{ color:var(--accent); background:transparent !important; }
.sefaria-btn{ min-height:44px; display:inline-flex; align-items:center; gap:5px; background:none !important; border:0 !important;
  color:var(--accent-ink) !important; font-size:13px; font-weight:500; padding:0 8px; box-shadow:none !important; }
html[data-dark] .sefaria-btn{ color:var(--accent-ink) !important; }
.sefaria-btn:hover{ text-decoration:underline; }
.welcome-skip, .daily-banner a{ font-size:14px; padding:12px 0; display:inline-block; }

/* ── LM lesson card (A7) ───────────────────────────────────────────── */
#resultsArea .entry.lm-card > .entry-header, .inspire-card .entry.lm-card > .entry-header{
  display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:6px 20px; align-items:start;
  padding:16px 14px 10px 20px; cursor:pointer; direction:ltr; flex-wrap:nowrap;
}
.lmc-en{ direction:ltr; text-align:left; display:flex; flex-direction:column; gap:3px; min-width:0; }
.lmc-ref{ font-size:12.5px; font-weight:500; color:var(--ink-3); }
.lmc-title-en{ font-size:16px; font-weight:600; line-height:1.35; color:var(--ink); }
.lmc-counts{ font-size:13px; color:var(--ink-2); display:flex; flex-wrap:wrap; gap:4px 12px; }
.lmc-counts b{ font-weight:700; color:var(--ink); }
.lmc-actions{ display:flex; align-items:center; gap:2px; margin:2px 0 0 -8px; flex-wrap:wrap; }
.lmc-actions .fav-star, .lmc-actions .share-btn{ width:44px; height:44px; }
.lmc-he{ direction:rtl; text-align:right; display:flex; flex-direction:column; align-items:flex-end; gap:4px; min-width:0; }
.lmc-he-row{ display:flex; align-items:baseline; gap:12px; direction:rtl; }
#resultsArea .lm-card .entry-num, .inspire-card .lm-card .entry-num{ font-family:var(--font-he); font-size:30px; font-weight:400; color:var(--ink-3); line-height:1; }
#resultsArea .lm-card .entry-title, .inspire-card .lm-card .entry-title{ font-family:var(--font-he); font-size:25px; font-weight:600; line-height:1.25; color:var(--ink); white-space:normal; transition:color var(--t-fast) var(--ease); }
#resultsArea .lm-card .entry-book, .inspire-card .lm-card .entry-book{ font-family:var(--font-he); font-size:15px; color:var(--ink-3); background:none; padding:0; font-weight:400; letter-spacing:0; }
.lmc-tags{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.lmc-tags .tefila-badge, .lmc-tags > span{ font-family:var(--font-ui); font-size:13.5px; color:var(--ink-2) !important; background:var(--surface-2) !important; border:0 !important; border-radius:var(--r-pill); padding:2px 10px; }
.lm-card .card-toggle-arrow{ display:none; }
.read-btn{ display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 14px; border-radius:var(--r-pill); border:0;
  background:var(--accent); color:var(--on-accent); font:inherit; font-size:13.5px; font-weight:600; cursor:pointer; margin-right:4px; }
.read-btn:hover{ background:var(--accent-hover); }
.read-btn svg{ width:15px; height:15px; }
.read-link{ display:inline-flex; align-items:center; gap:5px; min-height:44px; padding:0 8px; border:0; background:none; color:var(--accent-ink); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
@media (max-width:599px){
  #resultsArea .entry.lm-card > .entry-header{ grid-template-columns:1fr; padding:14px 8px 6px 16px; }
  .lmc-he{ order:-1; }
  #resultsArea .lm-card .entry-title{ font-size:23px; }
  .lmc-ref{ display:none; }
}

/* open lesson: segmented control (A8) */
.lm-tabs{ position:sticky; top:calc(var(--sat-eff) + var(--header-h) + 4px); z-index:5; display:grid; grid-template-columns:1.15fr 1.1fr 1fr .8fr;
  background:var(--surface-3); border-radius:var(--r-pill); padding:3px; margin:4px 16px 10px; direction:ltr; }
@media (max-width:599px){ .lm-tabs{ top:calc(var(--sat-eff) + var(--header-h) + 4px); margin:4px 10px 10px; } }
.lm-tabs button{ height:36px; border:0; border-radius:var(--r-pill); background:transparent; font:inherit; font-size:13.5px; font-weight:500;
  color:var(--ink-2); white-space:nowrap; cursor:pointer; transition:background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.lm-tabs button i{ font-style:normal; font-size:12px; color:var(--ink-3); margin-left:3px; }
.lm-tabs button[aria-selected="true"]{ background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow-1); }
.lm-tabs button[aria-selected="true"] i{ color:var(--accent); }
.lm-tabs button:disabled{ opacity:.45; cursor:default; }
.lm-panel{ animation:panelIn var(--t-med) var(--ease); }
.lm-panel[hidden]{ display:none !important; }
@keyframes panelIn{ from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none} }
.lm-panel > .lm-sec{ border-top:1px solid var(--line); }
.lm-panel > .lm-sec > .lm-sec-body, .lm-panel.lm-flat .lm-sec-body{ display:block; }
.lm-panel .lm-sec.lm-flat > .lm-sec-head{ display:none; }
.lm-panel .lm-sec.lm-flat > .lm-sec-body{ display:block !important; max-height:none !important; }
.lm-said{ margin:0 16px 10px; padding:12px 14px; border-radius:var(--r-sm); background:var(--surface-2); }
.lm-said .topics-label{ padding:0 0 6px !important; }
.lm-said .said-block{ padding:0 !important; margin:0 !important; background:none !important; border:0 !important; }
.lm-said.is-clamped .said-he, .lm-said.is-clamped .said-en{ display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.lm-said .said-more{ border:0; background:none; color:var(--accent-ink); font:inherit; font-size:13px; font-weight:600; padding:8px 0 0; cursor:pointer; }
.halacha-item{ min-height:48px; align-items:center; }
.halachos-list .halacha-item{ border-radius:var(--r-sm); }
.halacha-group-label{ font-family:var(--font-ui); font-size:12px; font-weight:600; color:var(--ink-3); padding:10px 4px 2px; direction:rtl; text-align:right; }

/* ── Today's Learning card (right rail / first card on phone) ─────────── */
#railRight .daily-banner{
  background:var(--accent) !important; color:var(--on-accent); border:0; border-radius:var(--r-card); padding:16px; box-shadow:var(--shadow-1);
  direction:ltr; text-align:left;
}
#railRight .daily-banner-header{ padding:0 !important; cursor:default !important; display:block !important; background:none !important; }
#railRight #dailyBannerArrow{ display:none !important; }
#railRight .daily-tl-label{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; opacity:.85; }
#railRight .daily-tl-title{ font-family:var(--font-display); font-weight:700; font-size:24px; line-height:1.15; margin:2px 0 8px; }
#railRight .daily-date-row{ display:flex !important; justify-content:space-between !important; gap:8px; font-size:12.5px; opacity:.9; margin:0 0 4px; flex-wrap:wrap; }
#railRight .daily-date-row *{ color:var(--on-accent) !important; }
#railRight .daily-date-sep{ display:none; }
#railRight #dailyBannerContent{ display:block !important; }
#railRight .daily-grid{ display:grid !important; grid-template-columns:1fr; gap:10px; margin-top:10px !important; }
#railRight .daily-card{ background:color-mix(in srgb, var(--on-accent) 12%, transparent) !important; border:0 !important; border-radius:12px; padding:12px !important; color:var(--on-accent) !important; box-shadow:none !important; text-align:left; }
#railRight .daily-card *{ color:var(--on-accent) !important; }
#railRight .daily-card-label{ font-size:12px !important; font-weight:600; letter-spacing:.06em; text-transform:uppercase; opacity:.85; }
#railRight .daily-card-main{ font-family:var(--font-he); font-size:24px !important; font-weight:700; direction:rtl; text-align:right; margin:2px 0; }
#railRight .daily-card-sub{ direction:rtl; text-align:right; font-size:14px !important; }
#railRight .daily-card-sub-en{ font-size:12.5px !important; opacity:.85; }
#railRight .daily-explore-btn{ margin-top:8px; min-height:36px; border-radius:var(--r-pill); border:0; background:var(--on-accent) !important; color:var(--accent) !important; font:inherit; font-size:13px; font-weight:600; padding:0 14px; cursor:pointer; }
.daily-progress{ height:4px; border-radius:4px; background:color-mix(in srgb, var(--on-accent) 25%, transparent); margin-top:8px; overflow:hidden; }
.daily-progress > span{ display:block; height:100%; background:var(--on-accent); border-radius:4px; }
@media (min-width:600px) and (max-width:899px){ #railRight .daily-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:599px){ #railRight .daily-grid{ grid-template-columns:1fr 1fr; } #railRight .daily-card-main{ font-size:20px !important; } #railRight .daily-tl-title{ font-size:22px; } }

/* Resume (right rail) — every run in its own isolated span, English first */
#railRight .resume-chip{ margin:0; width:auto; max-width:none; border-radius:var(--r-card); padding:10px 8px 10px 14px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow-1); font-size:14px; }
.resume-go{ display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:0; flex:1; text-align:left; background:none; border:0; font:inherit; color:var(--ink); cursor:pointer; padding:0; }
.resume-lead{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); }
.resume-chip-title{ display:block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; unicode-bidi:isolate; }
.resume-chip-title [dir="rtl"]{ unicode-bidi:isolate; font-family:var(--font-ui); font-size:16px; font-weight:600; }
.resume-chip-title .rc-sub{ display:block; font-size:12.5px; color:var(--ink-3); font-weight:500; }
.resume-ic{ width:34px; height:34px; border-radius:50%; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; flex:none; }
.resume-chip .resume-ic{ display:grid; place-items:center; align-self:center; margin:0; padding:0; line-height:0; }
.resume-chip .resume-ic svg{ display:block; margin:0; }
.newhere-card{ background:var(--surface-2); border-radius:var(--r-card); padding:16px; }
.newhere-card h3{ font-family:var(--font-display); font-size:22px; font-weight:700; margin:2px 0 6px; color:var(--ink); }
.newhere-card p{ font-size:13.5px; color:var(--ink-2); line-height:1.5; margin:0 0 10px; }
.btn-quiet{ display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:0 14px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink); font:inherit; font-size:13.5px; font-weight:600; cursor:pointer; }
.btn-quiet:hover{ border-color:var(--accent-mid-2); color:var(--accent-ink); }
.btn-primary{ display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 18px; border-radius:var(--r-pill); border:0; background:var(--accent); color:var(--on-accent); font:inherit; font-size:14px; font-weight:600; text-decoration:none; cursor:pointer; }
.btn-primary:hover{ background:var(--accent-hover); }

/* ── Welcome banner (replaces the first-visit modal) ─────────────────── */
.welcome-bar{ display:flex; align-items:center; gap:12px; padding:10px 6px 10px 16px; border-radius:var(--r-card); background:var(--accent-soft);
  font-size:14px; color:var(--ink-2); margin:0 0 var(--gap); direction:ltr; text-align:left; }
.welcome-bar .wb-text{ flex:1; min-width:0; line-height:1.45; }
.welcome-bar b{ color:var(--ink); }
.welcome-bar .wb-actions{ display:flex; gap:6px; flex-wrap:wrap; }
@media (max-width:599px){ .welcome-bar{ flex-wrap:wrap; } .welcome-bar .wb-actions{ order:3; width:100%; } }

/* ── Section picker: dropdown on iPad, bottom sheet on phone (A5) ─────── */
.sp-scrim{ position:fixed; inset:0; background:rgba(20,18,26,.28); opacity:0; transition:opacity var(--t-sheet) var(--ease); z-index:900; }
.sp-panel{ position:fixed; top:calc(var(--sat-eff) + var(--header-h) + 8px); left:20px; width:min(900px, calc(100vw - 40px));
  max-height:calc(100vh - var(--header-h) - var(--sat-eff) - 24px); overflow:auto; overscroll-behavior:contain;
  background:var(--surface); border-radius:18px; box-shadow:0 24px 60px rgba(20,18,26,.22); padding:14px; z-index:901; direction:ltr; text-align:left;
  opacity:0; transform:translateY(-6px); transition:opacity var(--t-sheet) var(--ease), transform var(--t-sheet) var(--ease); }
.sp-open .sp-scrim{ opacity:1; } .sp-open .sp-panel{ opacity:1; transform:none; }
.sp-search{ width:100%; height:40px; border-radius:var(--r-pill); border:0; background:var(--surface-2); color:var(--ink); padding:0 16px; font:inherit; font-size:16px; margin-bottom:10px; }
.sp-recent{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.sp-recent .sp-label{ padding:0 4px 0 2px; }
.sp-chip{ height:34px; padding:0 12px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink); font:inherit; font-size:13.5px; font-weight:500; cursor:pointer; }
.sp-groups{ display:grid; grid-template-columns:repeat(3,1fr); gap:4px 18px; }
.sp-label{ padding:8px 10px 4px; }
.sp-item{ width:100%; display:flex; justify-content:space-between; align-items:center; gap:10px; min-height:40px; padding:0 10px; border:0; border-radius:var(--r-sm);
  background:transparent; font:inherit; font-size:14px; font-weight:500; color:var(--ink-2); cursor:pointer; text-align:left; }
.sp-item:hover{ background:var(--surface-2); color:var(--ink); }
.sp-item.is-on{ background:var(--accent-soft); color:var(--accent-ink); font-weight:600; }
.sp-quick{ display:none; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:12px; }
.sp-quick button{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:62px; border-radius:12px; border:0; background:var(--surface-2); color:var(--ink); font:inherit; font-size:12.5px; font-weight:500; cursor:pointer; }
.sp-quick button svg{ width:20px; height:20px; color:var(--accent); }
.sp-quick .spq-size{ flex-direction:row; gap:6px; }
.sp-quick .spq-size span{ font-weight:600; }
.sp-handle{ display:none; width:40px; height:5px; border-radius:3px; background:var(--line-2); margin:0 auto 10px; }
@media (max-width:899px){ .sp-groups{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:599px){
  .sp-panel{ top:auto; bottom:0; left:0; width:100%; max-height:88vh; border-radius:20px 20px 0 0; padding:10px 16px calc(16px + var(--sab,0px)); transform:translateY(100%); }
  .sp-open .sp-panel{ transform:none; }
  .sp-groups{ grid-template-columns:1fr; }
  .sp-item{ min-height:48px; font-size:15px; }
  .sp-quick, .sp-handle{ display:grid; }
  .sp-handle{ display:block; }
}

/* ── Sheets: Inspire, Sources, Reader shell ──────────────────────────── */
.v2-scrim{ position:fixed; inset:0; background:rgba(20,18,26,.32); opacity:0; transition:opacity var(--t-sheet) var(--ease); z-index:1200; }
.v2-sheet{ position:fixed; z-index:1201; left:50%; bottom:0; width:min(760px,100%); max-height:88vh; display:flex; flex-direction:column;
  background:var(--bg); border-radius:20px 20px 0 0; box-shadow:0 -10px 40px rgba(20,18,26,.2);
  transform:translate(-50%,100%); transition:transform var(--t-sheet) var(--ease); direction:ltr; text-align:left; }
.v2-sheet.open{ transform:translate(-50%,0); } .v2-scrim.open{ opacity:1; }
.v2-sheet-head{ display:flex; align-items:center; gap:8px; padding:8px 8px 8px 18px; border-bottom:1px solid var(--line); }
.v2-sheet-head .vs-title{ flex:1; min-width:0; font-weight:600; font-size:15px; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.v2-sheet-head .vs-kicker{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); }
.v2-sheet-body{ overflow:auto; overscroll-behavior:contain; padding:14px 16px; flex:1; }
.v2-sheet-foot{ display:flex; gap:8px; justify-content:flex-end; padding:10px 16px calc(12px + var(--sab,0px)); border-top:1px solid var(--line); background:var(--bg); }
.v2-sheet-handle{ width:40px; height:5px; border-radius:3px; background:var(--line-2); margin:8px auto 0; }
.inspire-card .entry{ margin:0; }
.inspire-card{ direction:rtl; }
.back-chip{ position:fixed; left:50%; bottom:calc(20px + var(--sab,0px)); transform:translate(-50%,140%); z-index:950; display:inline-flex; align-items:center; gap:8px;
  height:44px; padding:0 18px; border-radius:var(--r-pill); border:0; background:var(--ink); color:var(--bg); font:inherit; font-size:14px; font-weight:600; box-shadow:var(--shadow-2);
  transition:transform var(--t-sheet) var(--ease); cursor:pointer; }
.back-chip.show{ transform:translate(-50%,0); }

/* Sources sheet text */
.src-he{ font-family:var(--font-he); font-size:21px; line-height:1.85; direction:rtl; text-align:right; color:var(--ink); }
.src-en{ font-size:15.5px; line-height:1.6; color:var(--ink-2); margin-top:6px; }
.src-seg{ padding:8px 0; border-bottom:1px solid var(--line); }
.attrib{ font-size:12.5px; color:var(--ink-3); line-height:1.5; }
.attrib a{ color:var(--accent-ink); font-weight:600; }
.lic{ display:inline-block; font-size:12px; font-weight:600; color:var(--accent-ink); background:var(--accent-soft); border-radius:6px; padding:0 6px; margin-left:4px; }

/* skeletons */
.skel{ display:block; height:14px; border-radius:7px; margin:10px 0; background:linear-gradient(90deg,var(--surface-2),var(--surface-3),var(--surface-2)); background-size:200% 100%; animation:skel 1.2s linear infinite; }
.skel.he{ margin-left:auto; } .skel.w60{ width:60%; } .skel.w80{ width:80%; } .skel.w90{ width:90%; } .skel.w40{ width:40%; }
@keyframes skel{ from{background-position:200% 0} to{background-position:-200% 0} }

/* ── Reader view (P3.2) ──────────────────────────────────────────────── */
.reader{ position:fixed; inset:0; z-index:1100; background:var(--bg); display:none; flex-direction:column; direction:ltr; text-align:left; }
.reader.open{ display:flex; }
html.reader-open body{ overflow:hidden; }
.reader-bar{ position:relative; flex:none; display:flex; align-items:center; gap:6px; padding:calc(var(--sat-eff) + 6px) 8px 6px 8px; min-height:var(--header-h);
  border-bottom:1px solid var(--line); background:color-mix(in srgb, var(--bg) 92%, transparent); }
.reader-back{ display:inline-flex; align-items:center; gap:4px; min-height:44px; padding:0 10px; border:0; background:none; color:var(--accent-ink); font:inherit; font-size:15px; font-weight:600; cursor:pointer; }
.reader-bar .rb-mid{ flex:1; min-width:0; display:flex; justify-content:center; }
.seg{ display:inline-grid; grid-auto-flow:column; background:var(--surface-3); border-radius:var(--r-pill); padding:3px; }
.seg button{ height:34px; min-width:72px; padding:0 12px; border:0; border-radius:var(--r-pill); background:transparent; color:var(--ink-2); font:inherit; font-size:13.5px; font-weight:500; cursor:pointer; }
.seg button[aria-pressed="true"]{ background:var(--accent); color:var(--on-accent); font-weight:600; }
.seg button.he-lbl{ font-family:var(--font-he); font-size:15px; }
.reader-main{ flex:1; overflow:auto; overscroll-behavior:contain; }
.reader-grid{ display:grid; grid-template-columns:220px minmax(0,1fr) 300px; gap:32px; max-width:1392px; margin:0 auto; padding:24px; }
.reader-toc{ position:sticky; top:0; align-self:start; max-height:calc(100vh - 120px); overflow:auto; }
.reader-toc button{ display:flex; justify-content:space-between; width:100%; min-height:34px; padding:0 12px; border:0; border-radius:var(--r-sm); background:none; color:var(--ink-2); font:inherit; font-size:14px; cursor:pointer; }
.reader-toc button.is-on{ background:var(--accent-soft); color:var(--accent-ink); font-weight:600; }
.reader-toc .he{ color:var(--ink-3); font-family:var(--font-he); }
.reader-side{ position:sticky; top:0; align-self:start; display:flex; flex-direction:column; gap:16px; }
.reader-side .side-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); padding:14px 16px; box-shadow:var(--shadow-1); font-size:13.5px; }
.reader-head .rh-ref{ font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); display:flex; justify-content:space-between; gap:12px; }
.reader-head .rh-title{ font-family:var(--font-he); font-size:30px; font-weight:600; line-height:1.3; direction:rtl; text-align:right; margin:6px 0 4px; color:var(--ink); }
.reader-head .rh-en{ font-family:var(--font-display); font-size:22px; font-weight:700; color:var(--ink); }
.reader-head .attrib{ margin:8px 0 14px; }
.r-sec-mark{ display:flex; align-items:center; gap:10px; margin:22px 0 8px; font-size:12px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); }
.r-sec-mark::after{ content:""; flex:1; height:1px; background:var(--line); }
.r-sec-mark .he{ font-family:var(--font-he); font-size:16px; color:var(--accent); letter-spacing:0; }
.r-seg{ padding:8px 10px; border-radius:10px; }
.r-seg.is-target{ background:var(--accent-soft); }
.r-he{ font-family:var(--font-he); font-size:var(--rd-he,22px); line-height:1.85; direction:rtl; text-align:right; color:var(--ink); }
.r-en{ font-size:16px; line-height:1.6; color:var(--ink-2); }
.reader[data-lang="he"] .r-en, .reader[data-lang="en"] .r-he{ display:none; }
.reader[data-lang="both"] .r-seg{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.reader[data-lang="both"] .r-en{ order:-1; }
.reader-foot{ flex:none; display:flex; gap:10px; justify-content:space-between; padding:10px 16px calc(10px + var(--sab,0px)); border-top:1px solid var(--line); background:var(--bg); }
.reader-error{ text-align:center; padding:48px 16px; color:var(--ink-2); }
@media (max-width:1199px){ .reader-grid{ grid-template-columns:minmax(0,1fr) 260px; } .reader-toc{ display:none; } }
@media (max-width:899px){
  .reader-grid{ grid-template-columns:minmax(0,1fr); padding:16px; gap:16px; }
  .reader-side{ position:static; order:2; }
  .reader[data-lang="both"] .r-seg{ display:block; }
  .reader[data-lang="both"] .r-en{ margin-top:6px; }
}
@media (min-width:900px){ .reader-foot{ display:none; } }

/* ── Kabbalah: the book as an inline card, never a popup (A13) ─────────── */
.book-card{ position:relative; display:flex; gap:20px; padding:20px 22px; margin-bottom:var(--gap); border-radius:var(--r-card); border:1px solid var(--accent-mid-2);
  background:linear-gradient(135deg, var(--accent-soft), transparent); direction:ltr; text-align:left; }
.book-icon{ width:72px; height:96px; flex:none; border-radius:8px; background:var(--accent); color:var(--on-accent); display:grid; place-items:center; box-shadow:0 6px 16px rgba(30,20,90,.25); }
.book-icon svg{ width:34px; height:34px; }
.book-card .v2-label{ padding:0 0 2px; color:var(--accent-ink); }
.book-name{ font-family:var(--font-display); font-size:27px; font-weight:700; line-height:1.1; color:var(--ink); }
.book-by{ font-size:13px; color:var(--ink-3); margin:2px 0 8px; }
.book-card p{ font-size:14px; color:var(--ink-2); line-height:1.55; margin:0 0 12px; }
.book-actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.book-store{ font-size:12.5px; color:var(--ink-3); }
.book-store button{ border:0; background:none; color:var(--accent-ink); font:inherit; font-weight:600; cursor:pointer; padding:10px 0; }
.book-x{ position:absolute; top:4px; right:4px; }
.book-list{ display:none; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:6px; margin-top:10px; }
.book-list.open{ display:grid; }
.book-list a{ display:flex; justify-content:space-between; align-items:center; min-height:40px; padding:0 12px; border-radius:var(--r-sm); background:var(--surface); border:1px solid var(--line); font-size:13px; color:var(--ink); text-decoration:none; }
@media (max-width:599px){ .book-card{ padding:16px; gap:14px; } .book-icon{ width:56px; height:76px; } .book-name{ font-size:23px; } }

/* overlays: dim backdrop fades, cards slide, no bounce */
.info-overlay, .kabbook-overlay, .gs-overlay{ transition:opacity var(--t-sheet) var(--ease); }

/* ── App bar (phone only, once per session, 8 seconds) ───────────────── */
@media (min-width:768px){ #appBar{ display:none !important; } }

/* ── Motion: respect "Reduce motion" ─────────────────────────────────── */
@media (prefers-reduced-motion:reduce){ *, *::before, *::after{ transition:none !important; animation:none !important; scroll-behavior:auto !important; } html{ scroll-behavior:auto; } }

/* ── Dark-mode touches for pieces with hard-coded light fills ─────────── */
html[data-dark] .daily-banner{ background:var(--accent) !important; }
html[data-dark] .site-header{ background:color-mix(in srgb, var(--bg) 86%, transparent); }

/* lesson card: the open body only shows when the card is open; tab panels drop their repeated heading */
.lm-card:not(.open) > .lm-open{ display:none; }
.lm-panel > .topics-label:first-child{ display:none; }
.halachos-list.grouped .section-pill{ display:none; }
.lib-author-tag{ cursor:pointer; text-decoration:underline; text-decoration-color:var(--accent-mid-2); text-underline-offset:3px; }
.lib-author-tag:hover{ color:var(--accent-ink); }

/* ── Section toolbar layout: search · filters · text size on one row, then the count ── */
@media (min-width:600px){
  .search-bar .search-inner{ display:grid !important; grid-template-columns:minmax(0,1fr) auto auto; grid-template-areas:"input filt fs" "body body body" "tools tools tools" "off off off";
    align-items:center; gap:8px 8px; max-width:none !important; direction:ltr; }
  .search-bar .search-scope-row{ display:contents !important; }
  .search-bar .search-input-wrap{ grid-area:input; margin:0; }
  .search-bar .filters-toggle{ grid-area:filt; align-self:center; margin:0; height:40px; border-radius:var(--r-pill); padding:0 14px; border:1px solid var(--line-2); background:var(--surface); box-shadow:var(--shadow-1); }
  .search-bar .filters-toggle.open{ border-color:var(--accent-mid-2); background:var(--accent-soft); }
  .search-bar .fs-ctrl{ grid-area:fs; }
  .search-bar .fs-btn{ width:40px; min-width:40px; height:40px; min-height:40px; border-radius:var(--r-pill); }
  .search-bar .filters-body{ grid-area:body; }
  .search-bar #searchToolbar{ grid-area:tools; justify-content:space-between !important; }
  .search-bar .offline-pill{ grid-area:off; justify-self:start; }
  .search-bar .filters-toggle-arrow .ft-word{ display:none; }
}
.fav-section-bar{ justify-content:flex-start !important; direction:ltr; margin:2px 0 10px !important; }
/* lesson card: the Hebrew column hugs the right edge */
.lmc-he{ align-items:flex-start; }
#resultsArea .lm-card .entry-num.long, .inspire-card .lm-card .entry-num.long{ font-size:22px; }
@media (max-width:599px){
  .section-head{ display:none !important; }
  #railRight .daily-banner{ padding:12px 14px; }
  #railRight .daily-tl-label{ display:none; }
  #railRight .daily-tl-title{ font-size:20px; margin:0 0 2px; }
  #railRight .daily-date-row{ font-size:12px; }
  #railRight .daily-grid{ gap:8px; margin-top:8px !important; }
  #railRight .daily-card{ padding:10px !important; }
  #railRight .daily-card-sub{ display:none; }
  #railRight .daily-card-label{ font-size:12px !important; letter-spacing:.04em; }
  #railRight .daily-explore-btn{ min-height:32px; padding:0 10px; font-size:12.5px; width:auto; }
  .phone-picker{ margin-top:2px; }
}
.phone-picker{ grid-column:1/-1; order:-2; margin:0 !important; }
#resultsArea{ padding-top:2px !important; }
.search-bar{ margin-bottom:0; }

/* ── One-row toolbar from 600px: search (with the count inside) · filters · expand/collapse · favourite/share section · A A ── */
@media (min-width:600px){
  .search-bar .search-inner{ grid-template-columns:minmax(0,1fr) auto auto auto !important; grid-template-areas:"input filt tools fs" "body body body body" "off off off off" !important; }
  .search-bar #searchToolbar{ grid-area:tools; display:flex !important; gap:6px; }
  .search-bar #resultsCount{ display:none !important; }
  .search-bar #toolbarRight{ gap:6px !important; }
  .search-bar #expandCollapseWrap .lh-view-btn{ width:40px; height:40px; padding:0 !important; border-radius:var(--r-pill); display:inline-grid; place-items:center; border:1px solid var(--line-2); background:var(--surface); box-shadow:var(--shadow-1); color:var(--ink-2); }
  .search-bar #expandCollapseWrap .ec-txt{ display:none; }
  #toolbarRight .fav-section-btn, #toolbarRight .share-section-btn{ width:40px; height:40px; border-radius:var(--r-pill); }
  .search-inner input{ padding-left:2.4rem; padding-right:3.6rem; }
  .search-icon{ left:0.9rem; right:auto; }
  .field-count{ display:inline-block; position:absolute; right:0.7rem; top:50%; transform:translateY(-50%); font-size:12px; font-weight:700; line-height:1.4; pointer-events:none;
    color:var(--accent-ink); background:var(--accent-soft); border:0; border-radius:980px; padding:1px 8px; }
  #searchInput:not(:placeholder-shown) ~ .field-count{ display:none; }
  .search-clear{ left:auto; right:0.6rem; }
}
@media (min-width:600px) and (max-width:1199px){ .section-head{ display:none !important; } }
#toolbarRight .share-section-btn{ background:var(--surface); border:1px solid var(--line-2); color:var(--ink-2); }
#toolbarRight .fav-section-btn{ background:var(--surface); border:1px solid var(--line-2); color:var(--ink-2); }
#toolbarRight .fav-section-btn.is-fav{ color:var(--fav); background:var(--fav-light); }
.intro-collapse-bar{ padding:0.55rem 0.9rem; box-shadow:none; border-color:var(--line); font-size:14px; }
@media (max-width:599px){ #railRight .daily-explore-btn{ display:none; } #dailyLH{ cursor:pointer; } }
.search-bar #expandCollapseWrap .ec-ic{ display:inline-flex !important; }
@media (max-width:1199px){ .layout{ padding-top:10px; } .search-bar{ padding:4px 0 8px; } }

/* phone: Today's Learning arrives collapsed; a tap on its title row opens it */
.daily-tl-chev{ display:none; }
@media (max-width:599px){
  #railRight .daily-banner-header{ cursor:pointer !important; position:relative; padding-right:36px !important; }
  #railRight .daily-banner:not(.v2-open) #dailyBannerContent{ display:none !important; }
  #railRight .daily-banner:not(.v2-open) .daily-date-row{ margin:0; }
  .daily-tl-chev{ display:grid; place-items:center; position:absolute; right:-6px; top:50%; transform:translateY(-50%); width:44px; height:44px; color:var(--on-accent); transition:transform var(--t-med) var(--ease); }
  #railRight .daily-banner.v2-open .daily-tl-chev{ transform:translateY(-50%) rotate(180deg); }
}
@media (max-width:599px){
  .reader-bar{ gap:2px; padding-left:2px; padding-right:2px; }
  .rb-back-lbl{ display:none; }
  .reader-back{ padding:0 8px; }
  .seg button{ min-width:0; padding:0 11px; }
  .reader-bar .icon-btn{ min-width:40px; padding:0 6px; }
}
.rail-left .nav-item > span:first-child{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.rail-left .nav-item .he{ white-space:nowrap; flex:none; }

/* ── Contrast fixes found by the audit ── */
.card-toggle-arrow{ color:var(--ink-3) !important; }
.open > .entry-header .card-toggle-arrow, .open > [class*="header"] .card-toggle-arrow, .open .card-toggle-arrow{ color:var(--accent) !important; }
.ic-icon, .chelek-badge, .sec-chelek{ color:var(--on-accent) !important; }
.sec-btn:not(.active), .sec-btn:not(.active) .sefer-en, .filter-btn:not(.active), .lh-view-btn:not(.active){ color:var(--ink-2) !important; }
.sec-btn.active, .filter-btn.active, .lh-view-btn.active{ background:var(--accent) !important; border-color:var(--accent) !important; color:var(--on-accent) !important; }
.sec-btn.active *, .filter-btn.active *, .lh-view-btn.active *{ color:var(--on-accent) !important; }
.lt-label{ color:var(--accent-ink) !important; }
.lm-tabs button i{ color:var(--ink-2); }
html[data-dark] .topic-tl, html[data-dark] .topics-label, html[data-dark] .lh-section-heading, html[data-dark] .topic-he{ color:var(--ink-2) !important; }
/* intro hero cards keep their white text on a deep purple in dark mode */
html[data-dark] .his-intro, html[data-dark] .shtz-intro, html[data-dark] [class$="-intro-card"], html[data-dark] .his-intro-quote, html[data-dark] .q-text, html[data-dark] .his-intro-cta{ background:linear-gradient(135deg,#3d2c9e,#271d63) !important; }

.gs-clear, .search-clear{ min-width:36px; min-height:36px; }
html[data-dark] .search-bar{ background:var(--bg) !important; }

/* ── iPhone app fixes (14 Oct): the toolbar must never be offset on a phone; dark mode calmer ── */
@media (max-width:599px){
  html .search-bar, html.safe-top .search-bar{ position:relative !important; top:auto !important; }
}
html[data-dark] body{ background:var(--bg); }
#safeTopCover{ background:color-mix(in srgb, var(--bg) 97%, transparent) !important; }
/* Large filled purple surfaces use a deeper purple in dark mode with white text,
   so they glow less; small purple text and links keep the lighter --accent. */
:root{ --accent-fill:var(--accent); --accent-fill-hover:var(--accent-hover); --on-accent-fill:#fff; }
#railRight .daily-banner, html[data-dark] .daily-banner{ background:var(--accent-fill) !important; color:var(--on-accent-fill); }
#railRight .daily-banner *, #railRight .daily-card *, #railRight .daily-date-row *{ color:var(--on-accent-fill) !important; }
#railRight .daily-card{ background:rgba(255,255,255,.12) !important; color:var(--on-accent-fill) !important; }
#railRight .daily-explore-btn{ background:#fff !important; color:var(--accent-fill) !important; }
.daily-progress{ background:rgba(255,255,255,.25); } .daily-progress > span{ background:#fff; }
.daily-tl-chev{ color:var(--on-accent-fill); }
.read-btn, .btn-primary, .seg button[aria-pressed="true"], .fav-count, .book-icon{ background:var(--accent-fill) !important; color:var(--on-accent-fill) !important; }
.read-btn:hover, .btn-primary:hover{ background:var(--accent-fill-hover) !important; }
.sec-btn.active, .filter-btn.active, .lh-view-btn.active{ background:var(--accent-fill) !important; border-color:var(--accent-fill) !important; color:var(--on-accent-fill) !important; }
.sec-btn.active *, .filter-btn.active *, .lh-view-btn.active *{ color:var(--on-accent-fill) !important; }
html[data-dark] .ic-icon, html[data-dark] .chelek-badge, html[data-dark] .sec-chelek{ background:var(--accent-fill) !important; color:#fff !important; }
/* toolbar icon buttons: one quiet style in both modes (only the buttons, never their wrappers) */
.search-bar #expandCollapseWrap .lh-view-btn, .search-bar .filters-toggle, #toolbarRight .fav-section-btn, #toolbarRight .share-section-btn{ background:var(--surface) !important; border:1px solid var(--line-2) !important; color:var(--ink-2) !important; box-shadow:var(--shadow-1); }
.search-bar .filters-toggle.open{ background:var(--accent-soft) !important; border-color:var(--accent-mid-2) !important; color:var(--accent-ink) !important; }
#toolbarRight .fav-section-btn.is-fav{ color:var(--fav) !important; }
#expandCollapseWrap, #toolbarRight .fav-section-bar{ background:none !important; border:0 !important; box-shadow:none !important; }
html[data-dark] .site-header{ background:rgba(48,48,52,.96); }
html[data-dark] .resume-ic{ background:var(--accent-soft); color:var(--accent); }
.search-bar .filters-toggle.open *{ color:var(--accent-ink) !important; }
#resultsArea{ padding-left:0 !important; padding-right:0 !important; max-width:none !important; }

/* Round 2 (R1): cards separate from the page; lesson text is full-strength ink */
html[data-dark] .lm-card,
html[data-dark] .entry{ border:1px solid var(--line); }
html[data-dark] #reader [lang=he],
html[data-dark] #reader .rd-en,
html[data-dark] .src-he,
html[data-dark] .src-en,
html[data-dark] #reader .r-he,
html[data-dark] #reader .r-en,
html[data-dark] .halacha-text{ color:var(--ink); }

/* ══ Round 2 (14 Oct 2026) ═══════════════════════════════════════════════ */
/* L3: fuller rows — Halachos, Tefilos, Eitzos, the Chain and the Library use the
   lesson-card layout: English side (title, one-line summary, counts, Read) and
   the Hebrew side, right-aligned and RTL. */
.v2-row{ display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); gap:4px 20px; align-items:start;
  padding:14px 14px 8px 20px !important; direction:ltr; flex-wrap:nowrap; min-width:0; }
.v2-row:has(> .lmc-he:empty){ grid-template-columns:minmax(0,1fr); }
.v2-row > .lmc-he:empty{ display:none; }
.v2-row .card-toggle-arrow{ display:none !important; }
.v2-row .lmc-title-en, .v2-row .lmc-title-en .entry-title, .v2-row .halacha-block-en, .v2-row .lib-en-t{ font-family:var(--font-ui); font-size:16px; font-weight:600; line-height:1.35; color:var(--ink); white-space:normal; direction:ltr; text-align:left; }
.v2-row .lmc-title-en .entry-title{ display:inline; padding:0; margin:0; background:none; }
.v2-row-sum{ font-size:13.5px; line-height:1.45; color:var(--ink-2); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.v2-row-tags{ display:inline-flex; flex-wrap:wrap; gap:6px; }
.v2-row .lmc-counts{ align-items:center; }
.v2-row .halacha-block-name, .v2-row .lmc-he .entry-title, .v2-row .lib-he-t{ font-family:var(--font-he); font-size:21px; font-weight:600; line-height:1.3; color:var(--ink);
  white-space:normal; overflow:visible; text-overflow:clip; flex:none; direction:rtl; text-align:right; }
.v2-row .lmc-he .entry-num{ font-family:var(--font-he); font-size:26px; font-weight:400; line-height:1.1; color:var(--ink-3); }
.v2-row .lmc-he .entry-book, .v2-row .lmc-he .lt-label{ font-family:var(--font-he); font-size:15px; font-weight:400; color:var(--ink-3); background:none; padding:0; border:0; letter-spacing:0; }
.v2-row .lmc-he .torah-combined{ font-size:14px; color:var(--accent-ink); }
.v2-row .lmc-actions{ margin-left:-8px; }
.v2-row-meta{ display:flex; align-items:center; flex-wrap:wrap; gap:4px 12px; min-height:44px; }
.v2-row-meta .lmc-actions{ margin:0 -6px 0 auto; flex-wrap:nowrap; }
.v2-row .lmc-he .lt-label, .v2-row .lmc-he .entry-book{ color:var(--ink-3) !important; }
.halacha-block > .v2-row, .lt-entry > .v2-row{ border-bottom:0; }
.halacha-block.open > .v2-row, .lt-entry.open > .v2-row, .entry.open > .v2-row{ border-bottom:1px solid var(--line); }
@media (max-width:599px){
  .v2-row{ grid-template-columns:minmax(0,1fr); padding:14px 8px 6px 16px !important; }
  .v2-row > .lmc-he{ order:-1; }
  .v2-row .halacha-block-name, .v2-row .lmc-he .entry-title, .v2-row .lib-he-t{ font-size:20px; }
}
/* Read on the sub-rows inside an open card (one halacha, one eitza) */
.lm-sec-head .lmc-actions{ margin:0 0 0 auto; flex-wrap:nowrap; }
.le-eitza-sef{ display:inline-flex; margin-left:auto; }
.le-eitza-sef .lmc-actions{ margin:0; flex-wrap:nowrap; }

/* R5: every Read button keeps its 36px pill look but has a 44px hit area */
.read-btn{ height:44px !important; border:4px solid transparent !important; background-clip:padding-box !important; padding:0 14px; }

/* R6: an author with no Chain card is plain text, never styled like a link */
.lib-author-plain{ color:var(--ink-2) !important; cursor:default; background:none !important; border:0 !important; }
.lib-author-plain:hover{ background:none !important; }
.entry-book.lib-author-none{ background:var(--surface-2) !important; color:var(--ink-2) !important; border:0 !important; cursor:default; text-decoration:none; }
.entry-book.lib-author-tag{ background:var(--accent-soft) !important; color:var(--accent-ink) !important; }
html[data-dark] #appBar{ background:color-mix(in srgb, var(--surface) 96%, transparent) !important; }

/* L1: home tiles (2 per row on a phone, 4 on a computer) */
#homeTiles[hidden]{ display:none; }
.home-tiles{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 20px; direction:ltr; }
.home-tile{ display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-height:112px; padding:14px 14px 12px; text-align:left;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); box-shadow:var(--shadow-1); cursor:pointer; font:inherit; color:var(--ink);
  transition:box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.home-tile .ht-he{ align-self:stretch; text-align:right; font-family:var(--font-he); font-size:20px; font-weight:600; line-height:1.2; color:var(--accent-ink); }
.home-tile .ht-en{ font-size:15px; font-weight:600; line-height:1.3; margin-top:2px; }
.home-tile .ht-sub{ font-size:13px; line-height:1.35; color:var(--ink-2); }
@media (hover:hover){ .home-tile:hover{ box-shadow:var(--shadow-2); transform:translateY(-1px); border-color:var(--line-2); } }
.home-tile:active{ transform:scale(.98); }
@media (max-width:1199px){ .home-tiles{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:599px){ .home-tiles{ gap:10px; margin:0 0 14px; } .home-tile{ min-height:104px; padding:12px; } .home-tile .ht-he{ font-size:19px; } .home-tile .ht-sub{ font-size:12.5px; } }

/* L2 + R7: one toolbar row — 56px, and 44px once the page scrolls; every control stays */
.v2-tools-btn{ display:none; }
@media (min-width:600px){
  .search-bar{ padding:8px 0 !important; }
  .search-bar .search-inner{ row-gap:0 !important; }
  .search-bar .filters-body{ margin-top:8px; }
  #toolbarRight .fav-section-bar{ margin:0 !important; }
  .section-head{ padding:0 2px 8px; }
  .layout{ padding-top:16px; }
  html.is-scrolled-page .search-bar{ padding:2px 0 !important; }
  html.is-scrolled-page .search-bar .search-scope-row,
  html.is-scrolled-page .search-bar .filters-toggle,
  html.is-scrolled-page .search-bar #searchToolbar{ opacity:1; max-height:none; overflow:visible; pointer-events:auto; margin:0; }
  html.is-scrolled-page .search-bar .filters-body:not(.open){ display:none; }
}
@media (min-width:600px) and (prefers-reduced-motion:no-preference){ .search-bar{ transition:padding 150ms var(--ease); } }
@media (prefers-reduced-motion:reduce){ .search-bar, .search-bar *{ transition:none !important; } }
@media (max-width:599px){
  .search-bar{ padding:6px 0 10px; }
  .search-bar .search-inner{ display:flex !important; flex-wrap:wrap; align-items:center; gap:8px; position:relative; direction:ltr; }
  .search-bar .search-input-wrap{ order:1; } .search-bar .filters-toggle{ order:2; } .v2-tools-btn{ order:3; }
  .search-bar .search-input-wrap{ flex:1 1 0; min-width:0; margin:0 !important; }
  .search-bar .filters-toggle{ flex:none; width:44px; height:44px; min-width:44px; padding:0 !important; margin:0 !important; justify-content:center; }
  .search-bar .filters-toggle .ft-label, .search-bar .filters-toggle .filters-toggle-arrow{ display:none !important; }
  .v2-tools-btn{ display:inline-grid; place-items:center; flex:none; width:44px; height:44px; border-radius:var(--r-pill); border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); box-shadow:var(--shadow-1); cursor:pointer; }
  .search-bar.tools-open .v2-tools-btn{ background:var(--accent-soft); color:var(--accent-ink); border-color:var(--accent-mid-2); }
  .search-bar .filters-body{ flex-basis:100%; order:10; }
  .search-bar #searchToolbar{ display:none !important; position:absolute; right:0; top:calc(100% + 6px); z-index:320; margin:0 !important;
    background:var(--surface); border:1px solid var(--line-2); border-radius:18px; box-shadow:var(--shadow-2); padding:6px; width:auto !important; }
  .search-bar.tools-open #searchToolbar{ display:block !important; }
  .search-bar #searchToolbar #toolbarRight{ display:flex !important; gap:6px; flex-wrap:nowrap; justify-content:flex-end; align-items:center; direction:ltr; }
  .search-bar #searchToolbar #expandCollapseWrap, .search-bar #searchToolbar .fav-section-bar{ display:flex !important; gap:6px !important; margin:0 !important; padding:0 !important; align-items:center; }
  .search-bar #searchToolbar button{ width:44px !important; height:44px !important; min-width:44px; }
}

/* L2: the About bar is a quiet line under the toolbar, not a card of its own */
#resultsArea > .intro-collapse:not(.open), #resultsArea > .about-wrap .intro-collapse:not(.open){ background:none !important; border:0 !important; box-shadow:none !important; margin-bottom:6px !important; }
#resultsArea > .intro-collapse:not(.open) > .intro-collapse-bar{ background:none !important; border:0 !important; box-shadow:none !important; padding:6px 4px !important; min-height:44px; }

/* L5: Start Here keeps the right rail, with a sticky "On this page" */
.toc-card[hidden]{ display:none !important; }
.toc-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-card); padding:14px 10px 10px; box-shadow:var(--shadow-1); display:flex; flex-direction:column; }
.toc-link{ text-align:left; min-height:36px; padding:0 10px; border:0; border-radius:var(--r-sm); background:none; color:var(--ink-2); font:inherit; font-size:14px; cursor:pointer; }
.toc-link:hover{ background:var(--surface-2); color:var(--accent-ink); }
@media (min-width:900px){ html[data-mode="about"] #aboutPanel .ab-toc{ display:none; } }
@media (max-width:899px){ .rail-right.on-about{ display:none !important; } }
.rail-right.on-about .resume-chip{ display:none !important; }

/* L4: the first lines of the lesson, faded, above the tabs */
.lm-peek[hidden]{ display:none; }
.lm-peek{ display:block; width:calc(100% - 32px); margin:4px 16px 12px; padding:12px 14px 10px; text-align:right; direction:rtl; cursor:pointer;
  background:var(--surface-2); border:0; border-radius:var(--r-sm); font:inherit; color:var(--ink); }
.lm-peek-he{ display:block; font-family:var(--font-he); font-size:19px; line-height:1.75; max-height:calc(1.75em * 3); overflow:hidden;
  -webkit-mask-image:linear-gradient(to bottom,#000 55%,transparent); mask-image:linear-gradient(to bottom,#000 55%,transparent); }
.lm-peek-cta{ display:block; direction:ltr; text-align:left; margin-top:2px; font-size:13px; font-weight:600; color:var(--accent-ink); }
@media (max-width:599px){ .lm-peek{ width:calc(100% - 20px); margin:4px 10px 10px; } .lm-peek-he{ font-size:18px; } }

/* R5: tap targets of at least 44×44 (the icon stays the same size) */
#appBar .ab-x{ width:44px !important; height:44px !important; min-width:44px; display:inline-grid; place-items:center; }
#appBar .ab-get{ min-height:44px; display:inline-flex !important; align-items:center; padding:0 18px !important; }
.seg button{ height:44px; }
.search-bar .lh-view-btn, .search-bar .filters-toggle, #toolbarRight .fav-section-btn, #toolbarRight .share-section-btn, .fs-btn{ min-height:44px; min-width:44px; }
@media (min-width:600px){ .search-bar .lh-view-btn, #toolbarRight .fav-section-btn, #toolbarRight .share-section-btn, .fs-btn{ min-height:40px; min-width:40px; height:40px; } .search-bar .filters-toggle{ min-height:40px; height:40px; } }
@media (max-width:599px){ .site-header .wm{ min-height:44px; display:inline-flex; align-items:center; } .site-header .header-search{ min-height:44px; height:44px; } }
.site-header{ background:color-mix(in srgb, var(--bg) 97%, transparent) !important; }
html[data-dark] .site-header{ background:rgba(48,48,52,.97) !important; }
.rail-right.on-about .toc-card{ order:-1; }
/* purple headers on the guide / What's New keep white text readable in both modes */
.info-card-head{ background:linear-gradient(160deg, var(--accent-fill) 0%, var(--accent-fill-hover) 100%) !important; color:var(--on-accent-fill) !important; }
.info-card-head .info-tagline, .info-card-head h2, .info-card-head .info-close{ color:var(--on-accent-fill) !important; }



/* ══════════════════════════════════════════════════════════════════════════
   OTZAR v3 · THE TREASURY (Dev Pack v3, October 2026)
   The design layer on top of v2. Every v2 mechanism (reader, lazy cards, data
   packs, share links, favourites, service worker) is kept; this block changes
   the shell and the skin. Tokens only: no hex values below the token blocks.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 3.4 Type: four families, self-hosted. The composite families draw every
   Hebrew letter with Frank Ruhl Libre and every Latin one with the family's own
   face, so mixed lines need no tagging. ── */
@font-face{font-family:'Figtree';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/figtree-latin-400-normal.woff2') format('woff2');}
@font-face{font-family:'Figtree';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/figtree-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'Figtree';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/figtree-latin-600-normal.woff2') format('woff2');}
@font-face{font-family:'Figtree';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/figtree-latin-700-normal.woff2') format('woff2');}
@font-face{font-family:'Frank Ruhl Libre';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-400-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;}
@font-face{font-family:'Frank Ruhl Libre';font-style:normal;font-weight:451 600;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-500-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;}
@font-face{font-family:'Frank Ruhl Libre';font-style:normal;font-weight:601 1000;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-700-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;}
@font-face{font-family:'Frank Ruhl Libre';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/frank-ruhl-libre-latin-400-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F;}
@font-face{font-family:'Frank Ruhl Libre';font-style:normal;font-weight:451 600;font-display:swap;src:url('/fonts/frank-ruhl-libre-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F;}
@font-face{font-family:'Frank Ruhl Libre';font-style:normal;font-weight:601 1000;font-display:swap;src:url('/fonts/frank-ruhl-libre-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F;}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/source-serif-4-latin-400-normal.woff2') format('woff2');}
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:300 700;font-display:swap;src:url('/fonts/source-serif-4-latin-400-italic.woff2') format('woff2');}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:451 550;font-display:swap;src:url('/fonts/source-serif-4-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:551 1000;font-display:swap;src:url('/fonts/source-serif-4-latin-600-normal.woff2') format('woff2');}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:300 550;font-display:swap;src:url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:551 650;font-display:swap;src:url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2');}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:651 1000;font-display:swap;src:url('/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2');}
/* composites: Hebrew half (Frank Ruhl, lifted so it sits level with the Latin) */
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-400-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F,U+20AA,U+25CC;size-adjust:112%;}
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:451 600;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-500-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F,U+20AA,U+25CC;size-adjust:112%;}
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:601 1000;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-700-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F,U+20AA,U+25CC;size-adjust:112%;}
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/figtree-latin-400-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:451 550;font-display:swap;src:url('/fonts/figtree-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:551 650;font-display:swap;src:url('/fonts/figtree-latin-600-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar UI';font-style:normal;font-weight:651 1000;font-display:swap;src:url('/fonts/figtree-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar Read';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-400-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F,U+20AA,U+25CC;size-adjust:110%;}
@font-face{font-family:'Otzar Read';font-style:normal;font-weight:451 1000;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-500-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F,U+20AA,U+25CC;size-adjust:110%;}
@font-face{font-family:'Otzar Read';font-style:normal;font-weight:300 450;font-display:swap;src:url('/fonts/source-serif-4-latin-400-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar Read';font-style:italic;font-weight:300 700;font-display:swap;src:url('/fonts/source-serif-4-latin-400-italic.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar Read';font-style:normal;font-weight:451 550;font-display:swap;src:url('/fonts/source-serif-4-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar Read';font-style:normal;font-weight:551 1000;font-display:swap;src:url('/fonts/source-serif-4-latin-600-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2190-2199,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'Otzar Display';font-style:normal;font-weight:300 550;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-500-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F;size-adjust:96%;}
@font-face{font-family:'Otzar Display';font-style:normal;font-weight:551 1000;font-display:swap;src:url('/fonts/frank-ruhl-libre-hebrew-700-normal.woff2') format('woff2');unicode-range:U+0590-05FF,U+FB1D-FB4F;size-adjust:96%;}
@font-face{font-family:'Otzar Display';font-style:normal;font-weight:300 550;font-display:swap;src:url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2122,U+2212;}
@font-face{font-family:'Otzar Display';font-style:normal;font-weight:551 650;font-display:swap;src:url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2122,U+2212;}
@font-face{font-family:'Otzar Display';font-style:normal;font-weight:651 1000;font-display:swap;src:url('/fonts/cormorant-garamond-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2122,U+2212;}

/* ── 3.2 Colour tokens (light) ── */
:root{
  --font-ui:'Otzar UI','Figtree',-apple-system,system-ui,'Segoe UI',sans-serif;
  --font-display:'Otzar Display','Cormorant Garamond','Frank Ruhl Libre',Georgia,serif;
  --font-he:'Frank Ruhl Libre','Noto Serif Hebrew','Times New Roman',serif;
  --font-read:'Otzar Read','Source Serif 4','Frank Ruhl Libre',Georgia,serif;
  --line:rgba(28,26,23,.08); --line-2:rgba(28,26,23,.14);
  --r-xs:8px; --r-sm:12px; --r-md:16px; --r-card:20px; --r-hero:26px; --r-sheet:28px; --r-pill:999px;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px; --sp-10:40px; --sp-12:48px;
  --gutter:20px; --tap:44px; --btn-h:48px; --tabbar-h:56px; --side-w:264px;
  --shadow-1:0 1px 2px rgba(28,26,23,.04),0 2px 8px rgba(28,26,23,.05);
  --shadow-2:0 12px 32px rgba(28,26,23,.12),0 2px 8px rgba(28,26,23,.06);
  --shadow-hero:0 10px 24px rgba(36,31,92,.22);
  --ease:cubic-bezier(.2,.8,.2,1); --ease-sheet:cubic-bezier(.32,.72,0,1);
  --t-fast:150ms; --t-med:220ms; --t-sheet:320ms;
  --bg:#FAF7F2; --surface:#FFFFFF; --surface-2:#F2EDE4; --surface-3:#E7E0D3;
  --ink:#1C1A17; --ink-2:#5C564E; --ink-3:#6B645A;
  --accent:#5E3DE8; --accent-hover:#4C2DD0; --accent-ink:#4527B8; --accent-soft:#F1EDFD; --accent-mid:#E3DBFB; --accent-mid-2:#E3DBFB;
  --on-accent:#FFFFFF; --accent-fill:#5E3DE8; --accent-fill-hover:#4C2DD0; --on-accent-fill:#FFFFFF;
  --royal:#241F5C; --on-royal:#F6F1E6; --on-royal-2:#CFC9E4;
  --gilt:#E3C47E; --gilt-ink:#7A5A1E; --on-gilt:#241F5C;
  --parchment:#F4EEDF; --highlight:#F3E3B8;
  --night:#1E2030; --on-night:#EDEAF7; --on-night-2:#C9C2F2;
  --shelf-core:#2B2566; --shelf-tikkun:#1E4D4F; --shelf-rnrn:#5C2A2A; --shelf-themes:#3F4A2A; --shelf-people:#4A3828;
  --danger:#B42318; --success:#1F7A4D;
  --scrim:rgba(15,13,20,.38);
  --gilt-frame:rgba(227,196,126,.38); --gilt-frame-2:rgba(227,196,126,.45);
  --royal-ghost:rgba(246,241,230,.13); --royal-line:rgba(246,241,230,.3); --royal-track:rgba(246,241,230,.18);
  --cover-spine:rgba(0,0,0,.22); --cover-lift:0 6px 14px rgba(0,0,0,.18);
  --rd-parch-bg:#F3ECDC; --rd-parch-ink:#2A2620; --rd-night-bg:#1F1E22; --rd-night-ink:#E8E2D6;
  --side-bg:var(--surface-2);
  /* older names, re-pointed at the v3 tokens (v2 rules pick up the new values) */
  --surface2:var(--surface-2); --surface3:var(--surface-3); --ink2:var(--ink-2); --ink3:var(--ink-3);
  --border:var(--line); --accent2:var(--accent-hover); --accent-light:var(--accent-soft);
  --radius:var(--r-card); --shadow-sm:var(--shadow-1); --shadow-md:var(--shadow-2); --shadow-lg:var(--shadow-2);
  --header-h:0px;
}
/* ── 4.2 Dark: soft graphite, designed not inverted ── */
html[data-dark]{
  --bg:#303034; --surface:#3D3D43; --surface-2:#46464D; --surface-3:#505058;
  --ink:#F5F5F7; --ink-2:#D6D6DB; --ink-3:#BCBCC4;
  --accent:#B6A7FF; --accent-hover:#C4B8FF; --accent-ink:#C8BCFF; --accent-soft:#3F3A58; --accent-mid:#4F4875; --accent-mid-2:#4F4875;
  --on-accent:#17161C; --accent-fill:#5E47D6; --accent-fill-hover:#6A55E0; --on-accent-fill:#FFFFFF;
  --royal:#2A2560; --on-royal:#F6F1E6; --on-royal-2:#D3CDEB;
  --gilt:#E3C47E; --gilt-ink:#E3C47E;
  --parchment:#45423C; --highlight:#6A5A33;
  --night:#24263A; --on-night:#EDEAF7; --on-night-2:#CFC9F5;
  --shelf-core:#3A3380; --shelf-tikkun:#235456; --shelf-rnrn:#6E3434; --shelf-themes:#46512E; --shelf-people:#5A4532;
  --danger:#FF8A80; --success:#6FD3A0;
  --line:rgba(255,255,255,.12); --line-2:rgba(255,255,255,.2);
  --shadow-1:0 0 0 1px rgba(255,255,255,.06);
  --shadow-2:0 16px 40px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.06);
  --shadow-hero:0 0 0 1px rgba(227,196,126,.18);
  --cover-lift:0 0 0 1px rgba(255,255,255,.1);
  --side-bg:#2A2A2E;
}

/* ── Base ── */
html{ -webkit-text-size-adjust:100%; }
body{ font-family:var(--font-ui); background:var(--bg); color:var(--ink); line-height:1.5; -webkit-font-smoothing:antialiased; margin:0; }
.v3-he, .v3 .he{ font-family:var(--font-he); direction:rtl; unicode-bidi:isolate; }
.v3-disp{ font-family:var(--font-display); font-variant-numeric:lining-nums; }
.v3-read{ font-family:var(--font-read); }
svg.i{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; flex:none; }
svg.i.sm{ width:18px; height:18px; } svg.i.xs{ width:16px; height:16px; } svg.i.lg{ width:24px; height:24px; }
.v3-label{ font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); line-height:1.4; }
.v3-meta{ font-size:13px; color:var(--ink-3); }
:focus-visible{ outline:2px solid var(--accent) !important; outline-offset:2px; }
.v3-sr{ position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ── The old furniture v3 replaces (section 10). Kept in the DOM because code
   still toggles it, but never shown. ── */
#siteHeader, .site-header, .hero:not(.v3-hero), .mobile-nav, #globalSearchBtn, #darkToggleBtn, #favNavBtn, #infoBtn,
#scrollTopBtn, #aboutBackBtn, #refBackBtn, #mnBackBtn, .back-chip, #sectionSheetOverlay, #welcomeOverlay, .welcome-bar,
.mobile-menu, .mobile-menu-backdrop, #railLeft, #railRight, .phone-picker, #homeTiles, #sectionHead, #welcomeHost,
.sp-scrim, .sp-panel, .search-scope-row, .filters-toggle, #v2ToolsBtn, #searchToolbar, .fav-section-bar,
#gsTopBtn, #globalSearchOverlay, .search-kb-hint, #layout .search-input-wrap{ display:none !important; }
/* ══ Shell: screens, tab bar, sidebar (section 5) ══ */
#v3App{ direction:ltr; text-align:left; min-height:100vh; }
.v3-scr{ display:none; direction:ltr; text-align:left; min-height:100vh; padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); box-sizing:border-box; }
html[data-scr="today"] #scrToday, html[data-scr="library"] #scrLibrary, html[data-scr="search"] #scrSearch,
html[data-scr="saved"] #scrSaved, html[data-scr="you"] #scrYou, html[data-scr="lesson"] #scrLesson, html[data-scr="page"] #scrPage{ display:block; }
html:not([data-scr="section"]) #layout{ display:none !important; }
.v3-wrap{ max-width:760px; margin:0 auto; padding:0 var(--gutter); box-sizing:border-box; }
.v3-scr *, #layout *, .v3-sheet *{ box-sizing:border-box; }
.v3-safe{ height:env(safe-area-inset-top, 0px); }
html.safe-top .v3-safe{ height:var(--sat, env(safe-area-inset-top, 0px)); }
#safeTopCover{ z-index:950 !important; }

/* push / pop motion (5.5) */
@keyframes v3PushIn{ from{ transform:translateX(100%); } to{ transform:none; } }
@keyframes v3PopIn{ from{ transform:translateX(-30%); filter:brightness(.92); } to{ transform:none; filter:none; } }
@keyframes v3Fade{ from{ opacity:0; } to{ opacity:1; } }
.v3-anim-push{ animation:v3PushIn var(--t-sheet) var(--ease-sheet) both; }
.v3-anim-pop{ animation:v3PopIn var(--t-sheet) var(--ease-sheet) both; }
.v3-ghost{ position:fixed !important; inset:0 auto auto 0; width:100%; z-index:5; pointer-events:none; transition:transform var(--t-sheet) var(--ease-sheet), filter var(--t-sheet) var(--ease-sheet); }
@media (prefers-reduced-motion:reduce){
  .v3-anim-push, .v3-anim-pop{ animation:v3Fade 120ms linear both; }
  .v3-ghost{ transition:none; }
}

/* ── large-title top bar (Today, Library, Saved, You, Search) ── */
.v3-top{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; padding:16px 0 0; }
.v3-top .v3-stack{ display:flex; flex-direction:column; min-width:0; }
.v3-title-xl{ font-family:var(--font-display); font-weight:600; font-size:44px; line-height:1; letter-spacing:-.01em; margin:0; color:var(--ink); font-variant-numeric:lining-nums; }
.v3-subtitle{ font-size:14px; color:var(--ink-2); margin-top:6px; }
@media (min-width:600px){ .v3-title-xl{ font-size:52px; } .v3-top{ padding-top:28px; } }

/* ── buttons (7.2) ── */
.v3-btn{ height:var(--btn-h); padding:0 20px; border-radius:24px; display:inline-flex; align-items:center; justify-content:center; gap:8px; font:inherit; font-weight:700; font-size:15px; white-space:nowrap; cursor:pointer; border:0; text-decoration:none; transition:background var(--t-fast) var(--ease), transform 100ms var(--ease); -webkit-tap-highlight-color:transparent; }
.v3-btn:active{ transform:scale(.98); }
.v3-btn svg.i{ width:18px; height:18px; }
.v3-btn-primary{ background:var(--accent-fill); color:var(--on-accent-fill) !important; }
.v3-btn-primary:hover{ background:var(--accent-fill-hover); }
.v3-btn-quiet{ background:transparent; border:1px solid var(--line-2); color:var(--ink) !important; font-weight:600; }
.v3-btn-quiet:hover{ background:var(--surface-2); }
.v3-btn-gilt{ background:var(--gilt); color:var(--on-gilt) !important; }
.v3-btn-ghost-royal{ background:transparent; border:1px solid var(--royal-line); color:var(--on-royal) !important; font-weight:600; }
.v3-btn-block{ width:100%; }
.v3-btn[disabled]{ opacity:.4; pointer-events:none; }
@media (min-width:1100px){ .v3-btn{ font-size:14px; } }
.v3-link{ display:inline-flex; align-items:center; gap:4px; font:inherit; font-weight:600; font-size:14px; color:var(--accent-ink) !important; min-height:44px; background:none; border:0; cursor:pointer; padding:0; text-decoration:none; }
.v3-icon-btn{ width:44px; height:44px; border-radius:22px; display:inline-flex; align-items:center; justify-content:center; background:var(--surface); box-shadow:var(--shadow-1); color:var(--ink); border:0; cursor:pointer; flex:none; padding:0; transition:background var(--t-fast) var(--ease), transform 100ms var(--ease); }
.v3-icon-btn:active{ transform:scale(.96); }
.v3-icon-btn.accent{ color:var(--accent-ink); }
.v3-icon-btn.quiet{ background:var(--surface-2); box-shadow:none; }
.v3-icon-btn.quiet:hover{ background:var(--surface-3); }
.v3-icon-btn.on{ background:var(--accent-soft); color:var(--accent-ink); box-shadow:none; }
.v3-act{ width:44px; height:44px; border-radius:22px; display:inline-flex; align-items:center; justify-content:center; color:var(--ink-2); background:none; border:0; cursor:pointer; padding:0; flex:none; }
.v3-act:hover{ background:var(--surface-2); }
.v3-act.on{ color:var(--accent-ink); }
.v3-close{ width:36px; height:36px; border-radius:18px; background:var(--surface-3); display:inline-flex; align-items:center; justify-content:center; color:var(--ink-2); border:0; cursor:pointer; flex:none; padding:0; position:relative; }
.v3-close::after{ content:""; position:absolute; inset:-4px; }

/* ── fields, chips, tags, segmented control (7.2) ── */
.v3-field{ display:flex; align-items:center; gap:10px; height:48px; padding:0 14px; border-radius:var(--r-md); background:var(--surface-2); color:var(--ink-3); font-size:16px; position:relative; transition:background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.v3-field input{ flex:1; min-width:0; height:100%; border:0 !important; outline:0; background:transparent !important; font:inherit; font-size:16px; color:var(--ink); padding:0; box-shadow:none !important; }
.v3-field input::placeholder{ color:var(--ink-3); opacity:1; }
.v3-field:focus-within{ background:var(--surface); box-shadow:0 0 0 2px var(--accent); color:var(--accent-ink); }
.v3-field .v3-count{ font-size:12px; font-weight:700; color:var(--accent-ink); background:var(--accent-soft); padding:3px 8px; border-radius:10px; flex:none; }
.v3-field .v3-clear{ width:32px; height:32px; border-radius:16px; border:0; background:var(--surface-3); color:var(--ink-2); display:none; align-items:center; justify-content:center; cursor:pointer; flex:none; padding:0; }
.v3-field.has-val .v3-clear{ display:inline-flex; }
.v3-sq-btn{ width:48px; height:48px; border-radius:var(--r-md); background:var(--surface-2); display:inline-flex; align-items:center; justify-content:center; color:var(--ink); position:relative; border:0; cursor:pointer; flex:none; padding:0; }
.v3-sq-btn:hover{ background:var(--surface-3); }
.v3-sq-btn .v3-badge{ position:absolute; top:6px; right:6px; min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:var(--accent-fill); color:var(--on-accent-fill); font-size:10px; font-weight:700; display:none; align-items:center; justify-content:center; }
.v3-sq-btn.has-badge .v3-badge{ display:flex; }
.v3-chips{ display:flex; gap:8px; overflow-x:auto; white-space:nowrap; scrollbar-width:none; -webkit-overflow-scrolling:touch; padding:2px var(--gutter); margin:0 calc(-1 * var(--gutter)); scroll-padding-inline:var(--gutter); }
.v3-chips::-webkit-scrollbar{ display:none; }
.v3-chip{ height:36px; padding:0 14px; border-radius:18px; display:inline-flex; align-items:center; gap:6px; font:inherit; font-size:14px; font-weight:600; background:var(--surface); box-shadow:inset 0 0 0 1px var(--line-2); color:var(--ink); flex:none; border:0; cursor:pointer; white-space:nowrap; position:relative; }
.v3-chip::after{ content:""; position:absolute; inset:-4px 0; }
.v3-chip .v3-he{ font-size:15px; }
.v3-chip.is-on{ background:var(--ink); color:var(--bg); box-shadow:none; }
.v3-chip.accent.is-on, .v3-chip.is-filter{ background:var(--accent-fill); color:var(--on-accent-fill); box-shadow:none; }
.v3-chip .v3-x{ opacity:.8; display:inline-flex; }
.v3-tag{ height:26px; padding:0 10px; border-radius:13px; display:inline-flex; align-items:center; font-size:12px; font-weight:600; background:var(--accent-soft); color:var(--accent-ink); border:0; font-family:inherit; }
button.v3-tag{ cursor:pointer; position:relative; } button.v3-tag::after{ content:""; position:absolute; inset:-9px -2px; }
.v3-seg{ display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); padding:4px; border-radius:14px; background:var(--surface-2); gap:2px; }
.v3-seg > button{ height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; gap:6px; font:inherit; font-size:14px; font-weight:600; color:var(--ink-2); background:none; border:0; cursor:pointer; padding:0 8px; white-space:nowrap; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.v3-seg > button[aria-selected="true"], .v3-seg > button.is-on{ background:var(--surface); color:var(--ink); font-weight:700; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.v3-seg .n{ font-size:12px; color:var(--ink-3); font-weight:600; }
.v3-seg .v3-he{ font-size:15px; }
.v3-tabstrip{ display:flex; gap:20px; overflow-x:auto; scrollbar-width:none; border-bottom:1px solid var(--line); padding:0 var(--gutter); margin:0 calc(-1 * var(--gutter)); }
.v3-tabstrip::-webkit-scrollbar{ display:none; }
.v3-tabstrip button{ height:44px; display:flex; align-items:center; gap:6px; white-space:nowrap; font:inherit; font-size:15px; font-weight:600; color:var(--ink-2); position:relative; background:none; border:0; cursor:pointer; padding:0; flex:none; }
.v3-tabstrip button .v3-he{ font-size:15px; }
.v3-tabstrip button.is-on{ color:var(--ink); font-weight:700; }
.v3-tabstrip button.is-on::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:3px; border-radius:2px; background:var(--accent); }

/* ── groups, cells, cards ── */
.v3-card{ background:var(--surface); border-radius:var(--r-card); box-shadow:var(--shadow-1); }
.v3-group{ background:var(--surface); border-radius:var(--r-card); box-shadow:var(--shadow-1); overflow:hidden; }
.v3-group > .v3-cell + .v3-cell, .v3-group > * + .v3-cell{ border-top:1px solid var(--line); }
.v3-cell{ display:flex; align-items:center; gap:12px; min-height:56px; padding:12px 16px; width:100%; background:none; border:0; font:inherit; text-align:left; color:var(--ink); cursor:pointer; text-decoration:none; transition:background var(--t-fast) var(--ease); }
button.v3-cell:hover, a.v3-cell:hover{ background:var(--surface-2); }
button.v3-cell:active, a.v3-cell:active{ background:var(--surface-3); }
.v3-cell .grow{ flex:1; min-width:0; }
.v3-cell .t{ font-weight:600; font-size:16px; line-height:1.3; }
.v3-cell .s{ font-size:13px; color:var(--ink-3); margin-top:2px; }
.v3-cell .v3-chev{ color:var(--ink-3); display:inline-flex; }
.v3-cell .ic{ color:var(--ink-2); display:inline-flex; }
.v3-cell .end{ font-size:13px; color:var(--ink-3); }
.v3-pill-new{ height:22px; padding:0 9px; border-radius:11px; background:var(--accent-fill); color:var(--on-accent-fill); font-size:12px; font-weight:700; display:inline-flex; align-items:center; }
.v3-h2{ margin:0; font-family:var(--font-display); font-weight:600; font-size:24px; line-height:1.15; color:var(--ink); font-variant-numeric:lining-nums; }
@media (min-width:1100px){ .v3-h2{ font-size:26px; } }
.v3-num{ width:34px; height:34px; border-radius:17px; flex:none; display:inline-flex; align-items:center; justify-content:center; background:var(--parchment); color:var(--gilt-ink); font-family:var(--font-he); font-size:17px; line-height:1; font-weight:500; direction:rtl; }
.v3-num.sm{ font-size:12px; letter-spacing:-.02em; }
.v3-num.lat{ font-family:var(--font-ui); font-size:13px; font-weight:700; direction:ltr; }
.v3-num.gold{ background:var(--gilt); color:var(--on-gilt); }
.v3-set-label{ padding:22px 4px 8px; }

/* ── tab bar (5.3) ── */
.v3-tabbar{ position:fixed; left:0; right:0; bottom:0; z-index:900; height:calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding:0 8px env(safe-area-inset-bottom, 0px);
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); direction:ltr;
  background:color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter:blur(18px) saturate(1.4); backdrop-filter:blur(18px) saturate(1.4);
  border-top:1px solid var(--line); transition:transform var(--t-med) var(--ease); }
html.safe-top .v3-tabbar{ height:calc(var(--tabbar-h) + var(--sab, env(safe-area-inset-bottom, 0px))); padding-bottom:var(--sab, env(safe-area-inset-bottom, 0px)); }
.v3-tab{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:12px; font-weight:600; color:var(--ink-3) !important; position:relative; text-decoration:none; -webkit-tap-highlight-color:transparent; min-height:44px; }
.v3-tab svg.i{ width:24px; height:24px; }
.v3-tab[aria-current="page"]{ color:var(--accent-ink) !important; font-weight:700; }
.v3-tab[aria-current="page"] svg.i{ stroke-width:2.1; }
.v3-tab .dot{ position:absolute; top:7px; left:calc(50% + 8px); width:8px; height:8px; border-radius:4px; background:var(--accent); box-shadow:0 0 0 2px var(--bg); display:none; }
.v3-tab.has-dot .dot{ display:block; }
html.reader-open .v3-tabbar, html.v3-sheet-open .v3-tabbar, html.v3-kb .v3-tabbar{ transform:translateY(110%); }
html.v3-kb[data-scr="search"] .v3-tabbar{ transform:none; }
@media (min-width:600px) and (max-width:1099px){
  .v3-tabbar{ left:50%; right:auto; width:500px; transform:translateX(-50%); border:1px solid var(--line); border-bottom:0; border-radius:18px 18px 0 0; }
  html.reader-open .v3-tabbar, html.v3-sheet-open .v3-tabbar{ transform:translate(-50%,110%); }
  :root{ --gutter:32px; }
}

/* ── sidebar (>=1100, 6.15) ── */
.v3-side{ display:none; }
@media (min-width:1100px){
  .v3-tabbar{ display:none; }
  .v3-scr{ padding-bottom:48px; }
  :root{ --gutter:40px; }
  body{ padding-left:var(--side-w); }
  .v3-side{ display:flex; flex-direction:column; gap:18px; position:fixed; left:0; top:0; bottom:0; width:var(--side-w); z-index:800; direction:ltr; text-align:left;
    background:var(--side-bg); border-right:1px solid var(--line); padding:24px 14px 16px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
  html.safe-top .v3-side{ padding-top:calc(24px + var(--sat, 0px)); }
}
.v3-brand{ display:flex; align-items:center; gap:10px; padding:0 8px; text-decoration:none; background:none; border:0; cursor:pointer; text-align:left; font:inherit; }
.v3-brand img{ width:40px; height:40px; border-radius:11px; flex:none; }
.v3-brand .w{ font-family:var(--font-display); font-weight:700; font-size:22px; line-height:1; color:var(--ink); display:block; }
.v3-brand .h{ font-family:var(--font-he); font-size:14px; color:var(--gilt-ink); display:block; margin-top:3px; direction:rtl; text-align:left; unicode-bidi:isolate; }
.v3-side-search{ display:flex; align-items:center; gap:8px; height:40px; padding:0 10px; border-radius:12px; background:var(--surface); box-shadow:var(--shadow-1); color:var(--ink-3); font:inherit; font-size:14px; border:0; cursor:text; width:100%; text-align:left; }
.v3-kbd{ margin-left:auto; font-size:12px; font-weight:700; padding:2px 6px; border-radius:6px; background:var(--surface-2); color:var(--ink-2); box-shadow:inset 0 -1px 0 var(--line-2); font-family:var(--font-ui); }
.v3-side-nav{ display:flex; flex-direction:column; gap:2px; }
.v3-nav-i{ height:40px; padding:0 10px; border-radius:11px; display:flex; align-items:center; gap:12px; font:inherit; font-weight:600; font-size:14.5px; color:var(--ink) !important; background:none; border:0; cursor:pointer; text-decoration:none; width:100%; text-align:left; }
.v3-nav-i:hover{ background:color-mix(in srgb, var(--surface) 60%, transparent); }
.v3-nav-i[aria-current="page"]{ background:var(--surface); box-shadow:var(--shadow-1); color:var(--accent-ink) !important; }
.v3-nav-i svg.i{ width:20px; height:20px; }
.v3-side .v3-label{ padding:6px 10px 2px; }
.v3-shelf-i{ height:36px; padding:0 10px; display:flex; align-items:center; gap:10px; font:inherit; font-weight:600; font-size:13.5px; color:var(--ink); background:none; border:0; cursor:pointer; width:100%; text-align:left; border-radius:9px; }
.v3-shelf-i:hover{ background:color-mix(in srgb, var(--surface) 60%, transparent); }
.v3-shelf-i .sp{ width:11px; height:15px; border-radius:2px 4px 4px 2px; background:var(--shelf); flex:none; }
.v3-shelf-i .v3-chev-d{ margin-left:auto; color:var(--ink-3); transition:transform var(--t-med) var(--ease); display:inline-flex; }
.v3-shelf-i[aria-expanded="true"] .v3-chev-d{ transform:rotate(180deg); }
.v3-sub-list{ display:none; flex-direction:column; gap:1px; margin:2px 0 6px; }
.v3-shelf-i[aria-expanded="true"] + .v3-sub-list{ display:flex; }
.v3-sub-i{ min-height:34px; padding:0 10px 0 31px; display:flex; align-items:center; justify-content:space-between; gap:8px; font:inherit; font-size:13.5px; color:var(--ink-2) !important; border-radius:9px; background:none; border:0; cursor:pointer; width:100%; text-align:left; }
.v3-sub-i:hover{ background:color-mix(in srgb, var(--surface) 60%, transparent); }
.v3-sub-i.is-on{ background:var(--accent-soft); color:var(--accent-ink) !important; font-weight:700; }
.v3-sub-i .v3-he{ font-size:14px; white-space:nowrap; }
.v3-side-reader{ display:none; flex-direction:column; gap:2px; }
.v3-side-daf{ margin-top:auto; background:var(--royal); color:var(--on-royal); border-radius:18px; padding:14px 16px; display:flex; flex-direction:column; gap:4px; text-align:left; border:0; cursor:pointer; font:inherit; position:relative; }
.v3-side-daf::before{ content:""; position:absolute; inset:5px; border:1px solid var(--gilt-frame); border-radius:14px; pointer-events:none; }
.v3-side-daf .eb{ font-size:12px; font-weight:700; letter-spacing:.12em; color:var(--gilt); text-transform:uppercase; }
.v3-side-daf .he{ font-family:var(--font-he); direction:rtl; font-size:28px; line-height:1.05; text-align:right; font-weight:500; }
.v3-side-daf .s{ font-size:12px; color:var(--on-royal-2); }

/* ── toast (6.14) ── */
.v3-toast{ position:fixed; left:50%; bottom:calc(108px + env(safe-area-inset-bottom, 0px)); transform:translate(-50%, 12px); opacity:0; z-index:1600; background:var(--ink); color:var(--bg); border-radius:22px; height:44px; padding:0 18px; display:flex; align-items:center; gap:8px; font-size:14px; font-weight:600; white-space:nowrap; box-shadow:var(--shadow-2); pointer-events:none; transition:opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); direction:ltr; }
.v3-toast.show{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.v3-toast button{ font:inherit; font-weight:700; background:none; border:0; color:var(--gilt); cursor:pointer; padding:0 0 0 10px; height:44px; }
html[data-dark] .v3-toast button{ color:var(--accent-fill); }
@media (min-width:1100px){ .v3-toast{ bottom:32px; } }
#shareToast{ display:none !important; }

/* ── skeleton, empty, offline (6.14) ── */
.v3-skel{ display:block; border-radius:8px; background:linear-gradient(90deg,var(--surface-2),var(--surface-3),var(--surface-2)); background-size:200% 100%; animation:v3Shimmer 1.4s linear infinite; }
@keyframes v3Shimmer{ from{ background-position:200% 0; } to{ background-position:-200% 0; } }
@media (prefers-reduced-motion:reduce){ .v3-skel{ animation:none; } }
.v3-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:56px 24px; }
.v3-empty .ring{ width:72px; height:72px; border-radius:36px; background:var(--accent-soft); color:var(--accent-ink); display:flex; align-items:center; justify-content:center; }
.v3-empty .ring svg.i{ width:28px; height:28px; }
.v3-empty h3{ margin:4px 0 0; font-family:var(--font-display); font-weight:600; font-size:24px; color:var(--ink); }
.v3-empty p{ margin:0; font-size:14px; color:var(--ink-2); max-width:280px; line-height:1.5; }
.v3-offline{ padding:18px; display:flex; flex-direction:column; gap:10px; }
/* ══ Today (6.1) ══ */
#scrToday .v3-top{ padding-bottom:2px; }
.v3-datelabel{ display:flex; flex-wrap:wrap; align-items:baseline; gap:0 6px; }
.v3-datelabel .v3-he{ font-size:13px; letter-spacing:0; text-transform:none; font-weight:500; }
.v3-herorail{ display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; padding:2px var(--gutter) 18px; margin:16px calc(-1 * var(--gutter)) -2px; scroll-padding-inline:var(--gutter); }
.v3-herorail::-webkit-scrollbar{ display:none; }
.v3-hero{ flex:0 0 calc(100% - 64px); scroll-snap-align:start; min-height:236px; border-radius:var(--r-hero); background:var(--royal); color:var(--on-royal); position:relative; padding:22px; display:flex; flex-direction:column; justify-content:space-between; gap:14px; box-shadow:var(--shadow-hero); box-sizing:border-box; overflow:hidden; }
.v3-hero.alt{ background:var(--shelf-rnrn); }
.v3-hero-frame{ position:absolute; inset:8px; pointer-events:none; }
.v3-hero-frame rect{ fill:none; stroke:var(--gilt-frame); stroke-width:1; }
.v3-hero-eb{ font-size:12px; font-weight:700; letter-spacing:.08em; color:var(--gilt); text-transform:uppercase; }
.v3-hero-he{ font-family:var(--font-he); direction:rtl; font-size:46px; line-height:1.05; font-weight:500; text-align:right; color:var(--on-royal); }
.v3-hero-sub{ font-family:var(--font-he); direction:rtl; font-size:18px; color:var(--on-royal-2); text-align:right; margin-top:4px; }
.v3-hero-foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.v3-hero-meta{ font-size:13px; color:var(--on-royal-2); }
.v3-hero .v3-progress{ height:4px; border-radius:2px; background:var(--royal-track); overflow:hidden; width:100%; }
.v3-hero .v3-progress > b{ display:block; height:100%; background:var(--gilt); border-radius:2px; }
.v3-dots{ display:flex; gap:5px; align-items:center; }
.v3-dots i{ width:5px; height:5px; border-radius:3px; background:var(--royal-line); transition:width var(--t-med) var(--ease), background var(--t-med) var(--ease); }
.v3-dots i.on{ width:16px; background:var(--gilt); }
.v3-hero button.v3-hero-tap{ position:absolute; inset:0; background:none; border:0; cursor:pointer; border-radius:inherit; }
.v3-hero > *:not(.v3-hero-frame):not(.v3-hero-tap){ position:relative; z-index:1; }
@keyframes v3HeroIn{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:none; } }
@keyframes v3FrameDraw{ from{ stroke-dashoffset:var(--dash); } to{ stroke-dashoffset:0; } }
.v3-hero.v3-first{ animation:v3HeroIn var(--t-sheet) var(--ease) both; }
.v3-hero.v3-first .v3-hero-frame rect{ stroke-dasharray:var(--dash); animation:v3FrameDraw 600ms var(--ease) 120ms both; }
@media (prefers-reduced-motion:reduce){ .v3-hero.v3-first{ animation:v3Fade 120ms linear both; } .v3-hero.v3-first .v3-hero-frame rect{ animation:none; } }
.v3-today-body{ display:flex; flex-direction:column; gap:12px; }
.v3-continue{ display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:var(--r-card); background:var(--surface); box-shadow:var(--shadow-1); border:0; width:100%; text-align:left; font:inherit; color:var(--ink); cursor:pointer; position:relative; touch-action:pan-y; transition:transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease); }
.v3-continue .grow{ flex:1; min-width:0; }
.v3-continue .v3-he{ display:block; font-size:21px; font-weight:500; line-height:1.35; text-align:left; }
.v3-continue .v3-en-title{ display:block; font-size:16px; font-weight:600; line-height:1.35; }
.v3-ring{ width:46px; height:46px; position:relative; flex:none; }
.v3-ring svg{ width:46px; height:46px; transform:rotate(-90deg); }
.v3-ring .trk{ stroke:var(--accent-soft); stroke-width:4; fill:none; }
.v3-ring .val{ stroke:var(--accent); stroke-width:4; fill:none; stroke-linecap:round; }
.v3-ring span{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--accent-ink); }
.v3-two{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.v3-tile{ border-radius:var(--r-card); padding:16px; min-height:136px; display:flex; flex-direction:column; gap:6px; background:var(--surface); box-shadow:var(--shadow-1); border:0; font:inherit; color:var(--ink); text-align:left; cursor:pointer; transition:transform 100ms var(--ease); }
.v3-tile:active{ transform:scale(.98); }
.v3-tile.night{ background:var(--night); color:var(--on-night); box-shadow:none; }
.v3-tile.night .v3-label{ color:var(--on-night-2); }
.v3-tile .v3-he{ font-size:23px; line-height:1.2; text-align:right; display:block; }
.v3-tile .t{ font-weight:700; font-size:15px; line-height:1.3; }
.v3-tile .s{ font-size:12.5px; line-height:1.35; color:var(--ink-3); }
.v3-tile.night .s{ color:var(--on-night-2); }
.v3-tile .row{ display:flex; justify-content:space-between; align-items:center; }
.v3-tile .moon{ color:var(--gilt); display:inline-flex; }
.v3-word{ background:var(--parchment); border-radius:var(--r-card); padding:18px; display:flex; flex-direction:column; gap:10px; border:0; text-align:left; font:inherit; color:var(--ink); cursor:pointer; width:100%; }
.v3-word .v3-label{ color:var(--gilt-ink); }
.v3-word .v3-he{ font-size:22px; text-align:right; line-height:1.35; display:block; }
.v3-word blockquote{ margin:0; font-family:var(--font-display); font-weight:600; font-size:22px; line-height:1.3; color:var(--ink); font-variant-numeric:lining-nums; }
.v3-word .foot{ display:flex; justify-content:flex-end; align-items:center; margin:-6px -8px -8px 0; }
.v3-welcome{ background:var(--parchment); border-radius:var(--r-card); padding:20px; display:flex; flex-direction:column; gap:12px; margin-top:18px; }
.v3-welcome .head{ display:flex; justify-content:space-between; align-items:flex-start; }
.v3-welcome img{ width:52px; height:52px; border-radius:14px; display:block; }
.v3-welcome p{ margin:0; font-size:15px; line-height:1.5; color:var(--ink-2); }
.v3-welcome .acts{ display:flex; gap:10px; flex-wrap:wrap; }
.v3-today-shelf{ display:none; }
@media (min-width:600px){
  .v3-herorail{ overflow:visible; scroll-snap-type:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:22px 0 0; padding:0 0 4px; }
  .v3-hero{ flex:none; }
  .v3-hero .v3-dots{ display:none; }
  .v3-today-row{ display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr); gap:12px; }
  .v3-today-row .v3-two{ display:contents; }
  .v3-today-shelf{ display:block; margin-top:12px; }
}
@media (min-width:1100px){
  #scrToday .v3-wrap{ max-width:980px; }
  .v3-hero-he{ font-size:46px; }
}

/* ══ Library (6.2) ══ */
.v3-needs{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.v3-need{ height:58px; border-radius:var(--r-md); background:var(--surface); box-shadow:var(--shadow-1); padding:0 14px; display:flex; align-items:center; justify-content:space-between; gap:8px; font:inherit; font-weight:600; font-size:15px; color:var(--ink); border:0; cursor:pointer; text-align:left; transition:transform 100ms var(--ease), background var(--t-fast) var(--ease); }
.v3-need:hover{ background:var(--surface-2); }
.v3-need:active{ transform:scale(.98); }
.v3-need .v3-he{ color:var(--accent-ink); font-size:16px; white-space:nowrap; }
.v3-need.royal{ background:var(--royal); color:var(--on-royal); box-shadow:none; }
.v3-need.royal .v3-he{ color:var(--gilt); }
@media (min-width:600px){ .v3-needs{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.v3-shelf{ margin-top:26px; }
.v3-shelf-h{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:10px; }
.v3-shelf-h h2{ margin:0; font-family:var(--font-display); font-weight:600; font-size:26px; line-height:1.15; color:var(--ink); }
.v3-shelf-row{ display:flex; gap:14px; overflow-x:auto; scrollbar-width:none; padding:4px var(--gutter) 10px; margin:0 calc(-1 * var(--gutter)); scroll-padding-inline:var(--gutter); scroll-snap-type:x proximity; }
.v3-shelf-row::-webkit-scrollbar{ display:none; }
.v3-shelf.is-grid .v3-shelf-row{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); overflow:visible; margin:0; padding:4px 0 10px; gap:16px 14px; }
@media (min-width:600px){ .v3-shelf.is-grid .v3-shelf-row{ grid-template-columns:repeat(5,minmax(0,1fr)); } }
.v3-book{ width:96px; flex:none; display:flex; flex-direction:column; gap:8px; color:var(--ink); background:none; border:0; padding:0; font:inherit; cursor:pointer; text-align:left; scroll-snap-align:start; transition:transform 100ms var(--ease); }
.v3-book:active{ transform:scale(.97); }
.v3-shelf.is-grid .v3-book{ width:auto; }
.v3-cover{ --w:96px; height:calc(var(--w) * 1.375); width:100%; border-radius:4px 10px 10px 4px; background:var(--shelf,var(--shelf-core)); box-shadow:inset 7px 0 0 var(--cover-spine), var(--cover-lift); position:relative; display:flex; align-items:center; justify-content:center; padding:0 10px 0 16px; box-sizing:border-box; }
.v3-cover::before{ content:""; position:absolute; inset:7px 7px 7px 13px; border:1px solid var(--gilt-frame-2); border-radius:4px; pointer-events:none; }
.v3-cover .v3-he{ color:var(--gilt); font-size:17px; line-height:1.18; text-align:center; font-weight:500; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; position:relative; }
.v3-book .t{ font-size:13px; font-weight:600; line-height:1.25; }
.v3-book .s{ font-size:12px; color:var(--ink-3); line-height:1.3; margin-top:-4px; }
.v3-shelf.is-grid .v3-cover{ height:auto; aspect-ratio:1/1.375; }
.v3-recent .v3-book{ width:72px; }
.v3-recent .v3-cover{ height:99px; }
.v3-recent .v3-cover .v3-he{ font-size:13px; }
.v3-find-results{ margin-top:8px; }
.v3-find-results:empty{ display:none; }

/* ══ Search (6.8) ══ */
.v3-search-top{ display:flex; align-items:center; gap:12px; padding-top:16px; }
.v3-search-top .v3-field{ flex:1; }
.v3-search-top .v3-cancel{ display:none; }
#scrSearch.is-active .v3-search-top .v3-cancel{ display:inline-flex; }
#scrSearch.is-active .v3-top{ display:none; }
.v3-also{ font-size:13px; color:var(--ink-3); margin:8px 2px 0; min-height:0; }
.v3-also .v3-he{ font-size:15px; color:var(--ink-2); }
.v3-res-sec{ margin-top:18px; }
.v3-res-sec > .v3-label{ display:block; margin:0 2px 8px; }
.v3-best{ background:var(--royal); color:var(--on-royal); border-radius:var(--r-card); padding:18px; display:flex; flex-direction:column; gap:8px; border:0; text-align:left; font:inherit; cursor:pointer; width:100%; box-shadow:var(--shadow-hero); }
.v3-best .src{ font-size:12px; font-weight:700; color:var(--gilt); letter-spacing:.04em; text-transform:uppercase; }
.v3-best .v3-he{ font-size:23px; text-align:right; display:block; line-height:1.3; }
.v3-best .t{ font-size:16px; font-weight:600; line-height:1.35; }
.v3-best .s{ font-size:14px; line-height:1.45; color:var(--on-royal-2); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.v3-best .v3-tag{ background:rgba(227,196,126,.2); color:var(--gilt); }
.v3-best .tags{ display:flex; gap:6px; flex-wrap:wrap; }
.v3-line{ display:flex; flex-direction:column; gap:6px; padding:14px 16px; background:var(--surface); border-radius:var(--r-card); box-shadow:var(--shadow-1); border:0; width:100%; text-align:left; font:inherit; color:var(--ink); cursor:pointer; margin-bottom:8px; }
.v3-line .top{ display:flex; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--ink-3); }
.v3-line .t{ font-size:15px; font-weight:600; }
.v3-line .snip{ font-size:15px; line-height:1.5; color:var(--ink); }
.v3-line .snip[dir="rtl"]{ font-family:var(--font-he); font-size:18px; text-align:right; }
mark, .v3-mark{ background:var(--highlight); color:inherit; border-radius:3px; padding:0 2px; }
.v3-recent-q .v3-cell{ min-height:48px; }
.v3-try{ display:flex; flex-wrap:wrap; gap:8px; }
.v3-try .v3-chip{ height:36px; }
.v3-hint{ text-align:center; font-size:13px; color:var(--ink-3); margin-top:22px; }
#scrSearch .v3-chips{ margin-top:12px; }

/* ══ Saved (6.9) ══ */
#scrSaved .v3-seg{ margin-top:16px; }
.v3-saved-list{ margin-top:6px; }
.v3-saved-list > .v3-label{ display:block; padding:18px 4px 8px; }
.v3-swipe{ position:relative; overflow:hidden; }
.v3-swipe .v3-swipe-del{ position:absolute; right:0; top:0; bottom:0; width:96px; display:flex; align-items:center; justify-content:center; background:var(--danger); color:var(--on-accent-fill); font-weight:700; font-size:14px; border:0; font-family:inherit; cursor:pointer; }
html[data-dark] .v3-swipe .v3-swipe-del{ color:var(--on-accent); }
.v3-swipe > .v3-lrow{ position:relative; z-index:1; background:var(--surface); transition:transform var(--t-med) var(--ease); }
.v3-row-x{ display:none; }
@media (hover:hover){ .v3-swipe:hover .v3-row-x{ display:inline-flex; } }
.v3-row-x{ position:absolute; right:56px; top:50%; transform:translateY(-50%); z-index:2; }

/* ══ You (6.10) ══ */
.v3-theme-pick{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:12px 16px 16px; }
.v3-theme-opt{ display:flex; flex-direction:column; align-items:center; gap:8px; font:inherit; font-size:13px; font-weight:600; color:var(--ink-2); background:none; border:0; cursor:pointer; padding:0; }
.v3-theme-opt .sw{ width:100%; height:76px; border-radius:14px; box-shadow:inset 0 0 0 1px var(--line-2); position:relative; overflow:hidden; display:block; }
.v3-theme-opt[aria-checked="true"] .sw{ box-shadow:inset 0 0 0 2.5px var(--accent); }
.v3-theme-opt[aria-checked="true"]{ color:var(--accent-ink); }
.v3-theme-opt .sw.light{ background:#FAF7F2; }
.v3-theme-opt .sw.dark{ background:#303034; }
.v3-theme-opt .sw.auto{ background:linear-gradient(90deg,#FAF7F2 50%,#303034 50%); }
.v3-theme-opt .sw i{ position:absolute; left:12px; right:12px; height:6px; border-radius:3px; }
.v3-theme-opt .sw.light i, .v3-theme-opt .sw.auto i:nth-child(odd){ background:#E7E0D3; }
.v3-theme-opt .sw.dark i{ background:#505058; }
.v3-theme-opt .sw i:nth-child(1){ top:16px; width:40%; } .v3-theme-opt .sw i:nth-child(2){ top:30px; } .v3-theme-opt .sw i:nth-child(3){ top:44px; width:60%; }
.v3-theme-opt .sw.auto i:nth-child(2){ background:linear-gradient(90deg,#E7E0D3 calc(50% - 12px),#505058 calc(50% - 12px)); }
.v3-you-head{ padding:14px 16px 0; font-weight:600; font-size:15px; }
.v3-switch{ width:51px; height:31px; border-radius:16px; background:var(--surface-3); position:relative; flex:none; appearance:none; -webkit-appearance:none; margin:0; cursor:pointer; border:0; transition:background var(--t-med) var(--ease); }
.v3-switch::after{ content:""; position:absolute; top:2px; left:2px; width:27px; height:27px; border-radius:14px; background:#fff; box-shadow:0 2px 4px rgba(0,0,0,.2); transition:left var(--t-med) var(--ease); }
.v3-switch:checked{ background:var(--accent-fill); }
.v3-switch:checked::after{ left:22px; }

/* ══ Pushed pages: nav bar (pushed screens) ══ */
.v3-navbar{ position:sticky; top:0; z-index:400; height:calc(52px + env(safe-area-inset-top, 0px)); padding-top:env(safe-area-inset-top, 0px); display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:8px; padding-left:8px; padding-right:12px;
  background:color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter:blur(18px) saturate(1.4); backdrop-filter:blur(18px) saturate(1.4); border-bottom:1px solid transparent; transition:border-color var(--t-med) var(--ease); }
html.safe-top .v3-navbar{ height:calc(52px + var(--sat, 0px)); padding-top:var(--sat, 0px); }
.v3-navbar.is-scrolled{ border-bottom-color:var(--line); }
.v3-back{ height:44px; display:inline-flex; align-items:center; gap:2px; padding:0 8px 0 2px; font:inherit; font-weight:600; font-size:16px; color:var(--accent-ink) !important; background:none; border:0; cursor:pointer; min-width:0; justify-self:start; max-width:100%; }
.v3-back span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.v3-nav-title{ text-align:center; font-weight:600; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--ink); max-width:46vw; }
.v3-nav-actions{ display:flex; gap:6px; justify-self:end; }
.v3-page-body{ padding-top:8px; padding-bottom:24px; }
.v3-page-body h1.v3-page-title{ font-family:var(--font-display); font-weight:600; font-size:34px; line-height:1.1; margin:6px 0 4px; color:var(--ink); }
.v3-prose{ font-family:var(--font-read); font-size:17px; line-height:1.6; color:var(--ink); }
.v3-prose h2, .v3-prose h3{ font-family:var(--font-display); font-weight:600; font-size:26px; line-height:1.15; margin:28px 0 10px; color:var(--ink); }
.v3-prose h3{ font-size:22px; }
.v3-prose p, .v3-prose li{ font-family:var(--font-read); }
.v3-prose ul{ padding-left:20px; }
.v3-prose strong{ font-weight:600; }
.v3-prose a, .v3-prose .ab-link{ color:var(--accent-ink); cursor:pointer; }
.v3-prose .info-he{ font-family:var(--font-he); }
.v3-prose .info-note{ background:var(--parchment); border-radius:var(--r-card); padding:4px 18px; }
.v3-prose .info-about-btn, .v3-prose .info-app-link{ display:inline-flex; align-items:center; min-height:44px; padding:0 18px; border-radius:24px; border:1px solid var(--line-2); color:var(--ink); background:none; font-family:var(--font-ui); font-size:15px; font-weight:600; text-decoration:none; cursor:pointer; margin:4px 8px 4px 0; }
.v3-prose .info-apps{ display:flex; flex-wrap:wrap; }
/* ══ Section page (6.3, 6.6) ══ */
#layout{ display:block !important; max-width:none !important; margin:0 !important; padding:0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px) !important; direction:ltr; grid-template-columns:none !important; }
#layout > .content{ direction:ltr; text-align:left; min-width:0; max-width:none; margin:0; padding:0; }
#resultsArea, #aboutPanel{ max-width:760px !important; width:auto !important; margin:0 auto !important; padding:0 var(--gutter) !important; box-sizing:border-box; }
#resultsArea{ direction:ltr; }
@media (min-width:1100px){ #layout{ padding-bottom:48px !important; } }

/* cover header */
.v3-sec-head{ --shelf:var(--shelf-core); background:var(--shelf); color:var(--on-royal); border-radius:0 0 28px 28px; padding:calc(env(safe-area-inset-top, 0px) + 6px) var(--gutter) 20px; display:flex; flex-direction:column; gap:12px; box-sizing:border-box; }
html.safe-top .v3-sec-head{ padding-top:calc(var(--sat, 0px) + 6px); }
.v3-sec-head .top{ display:flex; justify-content:space-between; align-items:center; gap:8px; min-height:52px; }
.v3-sec-head .v3-back{ color:var(--gilt) !important; }
.v3-sec-head .ibs{ display:flex; gap:8px; }
.v3-sec-head .ib{ width:44px; height:44px; border-radius:22px; background:var(--royal-ghost); display:inline-flex; align-items:center; justify-content:center; color:var(--on-royal); border:0; cursor:pointer; padding:0; }
.v3-sec-head .ib:hover{ background:var(--royal-line); }
.v3-sec-head .inner{ max-width:760px; width:100%; margin:0 auto; display:flex; flex-direction:column; gap:6px; }
.v3-sec-head .v3-he{ font-size:34px; line-height:1.1; color:var(--gilt); font-weight:500; text-align:right; display:block; }
.v3-sec-head h1{ margin:0; font-family:var(--font-display); font-weight:600; font-size:34px; line-height:1.05; color:var(--on-royal); }
.v3-sec-head .sub{ font-size:14px; color:var(--on-royal-2); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.v3-sec-head .sub::first-letter{ text-transform:uppercase; }
.v3-sec-head .prog{ display:flex; flex-direction:column; gap:6px; margin-top:8px; border:0; background:none; padding:0; text-align:left; font:inherit; color:inherit; cursor:pointer; width:100%; }
.v3-sec-head .prog .lbl{ display:flex; justify-content:space-between; gap:8px; font-size:12px; color:var(--on-royal-2); }
.v3-sec-head .prog .lbl b{ font-size:12px; font-weight:700; letter-spacing:.1em; color:var(--gilt); text-transform:uppercase; }
.v3-sec-head .prog .lbl .v3-he{ font-size:13px; display:inline; color:var(--gilt); }
.v3-sec-head .v3-progress{ height:4px; border-radius:2px; background:var(--royal-track); overflow:hidden; }
.v3-sec-head .v3-progress > b{ display:block; height:100%; background:var(--gilt); border-radius:2px; }
@media (min-width:600px){ .v3-sec-head .v3-he, .v3-sec-head h1{ font-size:36px; } .v3-sec-head{ border-radius:0 0 28px 28px; } }
@media (min-width:1100px){ .v3-sec-head .v3-he, .v3-sec-head h1{ font-size:40px; } .v3-sec-head{ padding-top:20px; } }
/* slim bar (6.6) */
.v3-slim{ position:fixed; left:0; right:0; top:0; z-index:700; background:var(--shelf, var(--shelf-core)); color:var(--on-royal); display:flex; align-items:center; gap:8px; padding:calc(env(safe-area-inset-top, 0px) + 4px) 12px 8px 4px; min-height:58px; box-sizing:border-box;
  transform:translateY(-100%); opacity:0; transition:transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease); pointer-events:none; }
html.safe-top .v3-slim{ padding-top:calc(var(--sat, 0px) + 4px); }
html.v3-slim-on[data-scr="section"] .v3-slim{ transform:none; opacity:1; pointer-events:auto; }
.v3-slim .v3-back{ color:var(--gilt) !important; padding:0 4px; }
.v3-slim .names{ flex:1; min-width:0; display:flex; flex-direction:column; }
.v3-slim .names .en{ font-family:var(--font-display); font-weight:600; font-size:22px; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.v3-slim .names .v3-he{ font-size:15px; color:var(--gilt); line-height:1.2; text-align:left; }
.v3-slim .ib{ width:44px; height:44px; border-radius:22px; background:var(--royal-ghost); display:inline-flex; align-items:center; justify-content:center; color:var(--on-royal); border:0; cursor:pointer; padding:0; }
@media (min-width:1100px){ .v3-slim{ left:var(--side-w); } }
/* search row + quick chips */
.v3-secbar{ position:sticky; top:0; z-index:600; background:var(--bg); padding:14px 0 8px; transition:box-shadow var(--t-med) var(--ease); }
html.v3-slim-on .v3-secbar{ top:var(--slim-h, 58px); box-shadow:0 1px 0 var(--line); }
.v3-secbar .inner{ max-width:760px; margin:0 auto; padding:0 var(--gutter); display:flex; flex-direction:column; gap:12px; }
.v3-secbar .row{ display:flex; gap:10px; align-items:center; }
.v3-secbar .v3-field{ flex:1; min-width:0; }
.v3-secbar #searchInput{ height:100% !important; border:0 !important; background:transparent !important; box-shadow:none !important; padding:0 !important; border-radius:0 !important; font-size:16px !important; text-align:left; color:var(--ink); width:auto; flex:1; min-width:0; outline:0; }
.v3-secbar #searchInput[dir="rtl"]{ text-align:right; font-family:var(--font-he); }
.v3-secbar #clearSearch{ position:static !important; transform:none !important; width:32px; height:32px; border-radius:16px; border:0; background:var(--surface-3) !important; color:var(--ink-2); font-size:13px; flex:none; display:none; align-items:center; justify-content:center; cursor:pointer; margin:0; padding:0; }
.v3-secbar .v3-chips:empty{ display:none; }
.v3-secbar .v3-seg{ max-width:420px; }
html[data-mode="about"] .v3-secbar, html[data-mode="fav"] .v3-secbar{ display:none; }
html[data-mode="about"] .v3-sec-head{ display:none; }
.v3-flash{ animation:v3Flash 1.2s var(--ease) both; }
@keyframes v3Flash{ 0%,30%{ background-color:var(--accent-soft); box-shadow:0 0 0 2px var(--accent-mid); } 100%{ } }
#resultsArea .ref-flash{ animation:v3Flash 1.2s var(--ease) both !important; }

/* hide what the v3 header, menu and Filter sheet now hold */
#resultsArea > .intro-collapse, #resultsArea .fav-section-bar, #resultsArea > .pdf-bar{ display:none !important; }
html[data-mode="his"] #resultsArea > .intro-collapse.v3-keep, html[data-mode="cn"] #resultsArea > .intro-collapse.v3-keep{ display:block !important; }
#resultsArea .match-hint{ margin:-4px 16px 10px; font-size:13px; color:var(--ink-2); cursor:pointer; }
#resultsArea .match-hint .match-where{ font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); }
#resultsArea .no-results{ direction:ltr; text-align:center; color:var(--ink-2); padding:24px 0; }

/* ══ One card system (7.2): every card ══ */
#resultsArea .v3c, #scrLesson .v3c, .v3-sheet .v3c{ background:var(--surface) !important; border:0 !important; border-radius:var(--r-card) !important; box-shadow:var(--shadow-1) !important; margin:0 0 12px !important; padding:0 !important; overflow:hidden; direction:ltr; text-align:left; transform:none !important; content-visibility:visible; }
#resultsArea > .v3c{ content-visibility:auto; contain-intrinsic-size:auto 88px; }
html.cv-off #resultsArea > .v3c, #resultsArea > .v3c.open{ content-visibility:visible; }
.v3c > .v3c-h{ display:grid !important; grid-template-columns:auto minmax(0,1fr) 32px; gap:12px; padding:16px !important; align-items:start !important; min-height:72px; cursor:pointer; background:none !important; border:0 !important; direction:ltr !important; text-align:left; flex-wrap:nowrap !important; position:relative; }
.v3c > .v3c-h:hover{ background:var(--surface-2) !important; }
.v3c.open > .v3c-h:hover{ background:none !important; }
.v3c > .v3c-h > :not(.v3c-num):not(.v3c-tt):not(.v3c-tog){ display:none !important; }
.v3c-num{ margin-top:2px; }
.v3c-num:empty{ display:none; }
.v3c-h.no-num{ grid-template-columns:minmax(0,1fr) 32px; }
.v3c-tt{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.v3c-tt > *{ order:0 !important; display:block !important; margin:0 !important; padding:0 !important; background:none !important; border:0 !important; position:static !important; }
.v3c-eb{ font-size:12px !important; font-weight:600 !important; color:var(--ink-3) !important; font-family:var(--font-ui) !important; line-height:1.4 !important; letter-spacing:0; text-transform:none; }
.v3c-he{ font-family:var(--font-he) !important; font-size:19px !important; line-height:1.3 !important; direction:rtl !important; text-align:right !important; color:var(--ink) !important; font-weight:400 !important; unicode-bidi:isolate; }
.v3c-en{ font-family:var(--font-ui) !important; font-size:16px !important; font-weight:600 !important; line-height:1.3 !important; color:var(--ink) !important; direction:ltr !important; text-align:left !important; font-style:normal !important; }
.v3c-sub{ font-size:13.5px !important; color:var(--ink-2) !important; line-height:1.4 !important; }
.v3c-tog{ width:32px; height:32px; border-radius:16px; background:var(--surface-2); display:inline-flex !important; align-items:center; justify-content:center; color:var(--ink-2); flex:none; margin-top:2px; transition:transform var(--t-med) var(--ease); }
.v3c-tog svg.i{ width:16px; height:16px; }
.v3c.open > .v3c-h .v3c-tog{ transform:rotate(180deg); }
.v3c > :not(.v3c-h){ direction:ltr; }
.v3c:not(.open) > :not(.v3c-h){ display:none !important; }
.v3c.open > :not(.v3c-h):not(.v3c-acts){ padding:0 16px 14px !important; margin:0 !important; background:none !important; border:0 !important; }
.v3c.open > .v3c-h + *{ border-top:1px solid var(--line) !important; padding-top:14px !important; }
.v3c-acts{ display:flex !important; align-items:center; justify-content:space-between; gap:4px; padding:4px 8px 8px 8px; border-top:0; }
.v3c-acts .l, .v3c-acts .r{ display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.v3c-acts .fav-star, .v3c-acts .share-btn, .v3-lesson-nav .fav-star{ width:44px !important; height:44px !important; border-radius:22px !important; display:inline-flex !important; align-items:center; justify-content:center; color:var(--ink-2) !important; background:none !important; border:0 !important; padding:0 !important; margin:0 !important; box-shadow:none !important; position:static !important; opacity:1 !important; }
.v3c-acts .fav-star:hover, .v3c-acts .share-btn:hover{ background:var(--surface-2) !important; }
.v3c-acts .fav-star svg, .v3c-acts .share-btn svg{ width:20px !important; height:20px !important; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
.fav-star.is-fav, .fav-star.is-fav svg{ color:var(--accent-ink) !important; }
.fav-star.is-fav svg path{ fill:currentColor !important; }
.v3c-acts .sefaria-btn, .v3c-acts .pdf-btn, .v3c-acts .v3-link, .v3c-acts a.v3-x-link{ display:inline-flex !important; align-items:center; gap:6px; min-height:44px; padding:0 8px !important; font-size:14px !important; font-weight:600 !important; color:var(--accent-ink) !important; background:none !important; border:0 !important; text-decoration:none; font-family:var(--font-ui) !important; box-shadow:none !important; border-radius:22px !important; width:auto !important; height:auto !important; }
.v3c-acts .read-btn{ height:40px; }
@keyframes v3Pop{ 0%{ transform:scale(1); } 50%{ transform:scale(1.15); } 100%{ transform:scale(1); } }
.fav-star.v3-pop svg{ animation:v3Pop 220ms var(--ease); }
/* entry bodies: Source Serif 16/1.6, labels small caps */
.v3c.open > :not(.v3c-h):not(.v3c-acts){ font-family:var(--font-read); font-size:calc(16px * var(--read-zoom, 1)); line-height:1.6; color:var(--ink); }
.v3c.open > :not(.v3c-h) [dir="rtl"], .v3c.open > :not(.v3c-h) [lang="he"]{ font-family:var(--font-he); }
.v3c.open .topics-label, .v3c.open .yh-src-label, .v3c.open .cn-src-label, .v3c.open .lh-src-label, .v3c.open .src-label, .v3c.open .summary-label, .v3c.open [class$="-label"]:not(.v3-label){ font-family:var(--font-ui) !important; font-size:12px !important; font-weight:700 !important; letter-spacing:.1em !important; text-transform:uppercase; color:var(--ink-3) !important; background:none !important; border:0 !important; padding:0 !important; margin:4px 0 8px !important; }
.v3c.open .topic-chip, .v3c.open .sch-tag, .v3c.open .tag-chip, .v3c.open [class*="topic-pill"], .v3c.open .al-topic{ display:inline-flex; align-items:center; min-height:26px; padding:2px 10px; border-radius:13px; background:var(--accent-soft) !important; color:var(--accent-ink) !important; border:0 !important; font-family:var(--font-ui); font-size:12px; font-weight:600; margin:0 6px 6px 0; }

/* ══ Lesson rows (7.2 .lrow) ══ */
#resultsArea#resultsArea .v3l{ background:var(--surface) !important; border:0 !important; box-shadow:none !important; margin:0 !important; border-radius:0 !important; padding:0 !important; overflow:visible; direction:ltr; content-visibility:auto; contain-intrinsic-size:auto 72px; }
#resultsArea#resultsArea .v3l > .v3l-h{ display:flex !important; align-items:center !important; gap:12px; padding:14px 16px !important; min-height:72px; cursor:pointer; background:none !important; border:0 !important; direction:ltr !important; flex-wrap:nowrap !important; grid-template-columns:none !important; position:relative; transition:background var(--t-fast) var(--ease); }
#resultsArea#resultsArea .v3l > .v3l-h:hover{ background:var(--surface-2) !important; }
#resultsArea#resultsArea .v3l > .v3l-h:active{ background:var(--surface-3) !important; }
#resultsArea#resultsArea .v3l > .v3l-h > :not(.v3l-tt):not(.v3l-he):not(.v3-num){ display:none !important; }
#resultsArea#resultsArea .v3l > :not(.v3l-h){ display:none !important; }
.v3l-tt{ flex:1; min-width:0; display:flex; flex-direction:column; }
.v3l-tt .t{ font-size:16px; font-weight:600; line-height:1.3; color:var(--ink); display:block; }
.v3l-tt .s{ font-size:12.5px; color:var(--ink-3); margin-top:3px; display:block; line-height:1.35; }
.v3l-he{ font-family:var(--font-he); direction:rtl; font-size:21px; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:46%; color:var(--ink); unicode-bidi:isolate; flex:none; }
#resultsArea#resultsArea .v3l + .v3l{ border-top:1px solid var(--line) !important; }
#resultsArea#resultsArea .v3l.v3-first, #resultsArea#resultsArea .v3l:first-child{ border-radius:var(--r-card) var(--r-card) 0 0 !important; }
#resultsArea#resultsArea .v3l.v3-last, #resultsArea#resultsArea .v3l:last-child{ border-radius:0 0 var(--r-card) var(--r-card) !important; margin-bottom:16px !important; }
#resultsArea#resultsArea .v3l.v3-first.v3-last{ border-radius:var(--r-card) !important; }
#resultsArea#resultsArea .v3l.v3-first > .v3l-h{ border-radius:var(--r-card) var(--r-card) 0 0; }
#resultsArea#resultsArea .v3l.v3-last > .v3l-h{ border-radius:0 0 var(--r-card) var(--r-card); }
#resultsArea#resultsArea .v3l{ box-shadow:var(--shadow-1) !important; }
html[data-dark] #resultsArea#resultsArea .v3l{ box-shadow:none !important; }
#resultsArea#resultsArea .v3l.is-cur > .v3l-h{ background:var(--accent-soft) !important; }
#resultsArea#resultsArea .v3l.is-sel > .v3l-h{ background:var(--royal) !important; }
#resultsArea#resultsArea .v3l.is-sel .t, #resultsArea#resultsArea .v3l.is-sel .v3l-he{ color:var(--on-royal); }
#resultsArea#resultsArea .v3l.is-sel .s{ color:var(--on-royal-2); }
#resultsArea#resultsArea .v3l.is-sel .v3-num{ background:var(--gilt); color:var(--on-gilt); }
/* section group headings inside lists (LH chelek headings etc.) */
#resultsArea .halacha-section-heading, #resultsArea .lh-section-heading, #resultsArea .cn-list-label, #resultsArea .his-group-label, #resultsArea .v3-group-label{ font-family:var(--font-ui) !important; font-size:12px !important; font-weight:700 !important; letter-spacing:.1em !important; text-transform:uppercase; color:var(--ink-3) !important; background:none !important; border:0 !important; padding:18px 4px 8px !important; margin:0 !important; direction:ltr; text-align:left; }

/* in-list view toggles (lt / le / his / cn) become a segmented control or tab strip */
#resultsArea > .lh-view-row, #resultsArea > .lt-view-toggle, #resultsArea > .his-view-row, #resultsArea > .cn-view-row{ display:none !important; }

/* ══ Lesson page (6.5) ══ */
#scrLesson .v3-wrap{ padding-bottom:24px; }
.v3-lesson-eb{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:10px; }
.v3-medal{ width:40px; height:40px; border-radius:20px; border:1.5px solid var(--gilt-ink); color:var(--gilt-ink); display:flex; align-items:center; justify-content:center; font-family:var(--font-he); font-size:22px; flex:none; direction:rtl; }
.v3-medal.sm{ font-size:14px; }
.v3-lesson-he{ font-family:var(--font-he); direction:rtl; text-align:right; font-size:36px; line-height:1.15; font-weight:500; margin:10px 0 0; color:var(--ink); }
.v3-lesson-en{ font-family:var(--font-display); font-size:30px; line-height:1.1; font-weight:600; margin:4px 0 0; color:var(--ink); font-variant-numeric:lining-nums; }
.v3-lesson-sub{ font-size:14px; color:var(--ink-2); margin-top:6px; line-height:1.45; }
@media (min-width:600px){ .v3-lesson-he{ font-size:44px; } .v3-lesson-en{ font-size:34px; } }
@media (min-width:1100px){ .v3-lesson-he{ font-size:46px; } .v3-lesson-en{ font-size:42px; } }
.v3-excerpt{ background:var(--parchment); border-radius:var(--r-card); padding:18px; display:flex; flex-direction:column; gap:14px; margin-top:18px; }
.v3-excerpt p{ margin:0; font-family:var(--font-he); direction:rtl; text-align:right; font-size:19px; line-height:1.75; color:var(--ink); -webkit-mask-image:linear-gradient(#000 60%,transparent); mask-image:linear-gradient(#000 60%,transparent); max-height:calc(19px * 1.75 * 3); overflow:hidden; }
.v3-excerpt p:empty{ display:none; }
.v3-excerpt .acts{ display:flex; gap:10px; flex-wrap:wrap; }
.v3-woven-h{ margin:28px 0 12px; }
.v3-woven{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; max-width:520px; }
.v3-stat{ height:72px; border-radius:var(--r-md); background:var(--surface); box-shadow:var(--shadow-1); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:0; font:inherit; cursor:pointer; color:var(--ink); padding:0 4px; }
.v3-stat b{ font-family:var(--font-display); font-size:27px; line-height:1; font-weight:700; font-variant-numeric:lining-nums; }
.v3-stat span{ font-size:12px; color:var(--ink-3); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.v3-stat[aria-selected="true"]{ box-shadow:inset 0 0 0 2px var(--accent); background:var(--accent-soft); color:var(--accent-ink); }
.v3-stat[aria-selected="true"] span{ color:var(--accent-ink); }
.v3-woven-panel{ margin-top:12px; }
.v3-woven-panel .v3-group{ padding:0; }
/* the reused card content inside a lesson page */
.v3-lp-body{ font-family:var(--font-ui); color:var(--ink); }
.v3-lp-body .v3-group{ margin-bottom:12px; }
.v3-lp-body .ref-link, .v3-lp-body .halacha-item, .v3-lp-body .parsha-torah-item, .v3-lp-body .lt-torah-row, .v3-lp-body .topic-chip, .v3-lp-body .le-eitza-item, .v3-lp-body .halacha-source-item{ cursor:pointer; }
.v3-lp-list{ display:flex; flex-direction:column; }
.v3-lp-list > *{ display:flex !important; align-items:center; gap:10px; min-height:56px; padding:12px 16px !important; margin:0 !important; background:none !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; flex-wrap:wrap; direction:ltr; }
.v3-lp-list > * + *{ border-top:1px solid var(--line) !important; }
.v3-lp-list > .ref-link::after{ content:""; width:16px; height:16px; margin-left:auto; flex:none; background:currentColor; color:var(--ink-3); -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
.v3-lp-list .torah-combined, .v3-lp-list .halacha-source-badge, .v3-lp-list .section-pill, .v3-lp-list .chelek-badge{ font-family:var(--font-ui); font-size:12.5px; color:var(--ink-3); background:none !important; border:0 !important; padding:0 !important; }
.v3-lp-list .torah-title, .v3-lp-list .lt-torah-title, .v3-lp-list .halacha-text, .v3-lp-list .halacha-source-title, .v3-lp-list .topic-he{ font-family:var(--font-he); font-size:19px; color:var(--ink); direction:rtl; unicode-bidi:isolate; }
.v3-lp-list .topic-tl{ font-size:15px; font-weight:600; color:var(--ink); }
.v3-lp-list .topic-meaning, .v3-lp-list .ps-lh-refs{ font-size:13px; color:var(--ink-3); }
.v3-lp-list span[style*="opacity"]{ display:none; }
.v3-lp-prose{ font-family:var(--font-read); font-size:calc(17px * var(--read-zoom,1)); line-height:1.6; }
.v3-lp-prose > *{ margin:0 0 14px; }
.v3-lp-sec + .v3-lp-sec{ margin-top:20px; }
.v3-lp-sec > .v3-label{ display:block; margin:0 4px 8px; }
/* lesson nav bar */
.v3-lesson-nav .fav-star{ background:var(--surface-2) !important; }
.v3-lesson-nav .fav-star.is-fav{ background:var(--accent-soft) !important; }
@media (min-width:1100px){
  #scrLesson .v3-navbar .v3-back{ visibility:visible; }
}

/* ══ Filter sheet + section menu (6.4, 6.6) ══ */
.v3-fgroup{ margin-top:16px; }
.v3-fgroup > .hd{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.v3-fgroup > .hd .cnt{ font-size:12px; color:var(--ink-3); }
.v3-fchips{ display:flex; flex-wrap:wrap; gap:8px; }
.v3-fchips.grid6{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); }
.v3-fchips.grid4{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); }
.v3-fchips.grid6 .v3-chip, .v3-fchips.grid4 .v3-chip{ justify-content:center; padding:0 6px; }
.v3-flist{ position:relative; }
.v3-flist .v3-field{ margin-bottom:6px; }
.v3-flist .rows{ display:flex; flex-direction:column; }
.v3-frow{ display:flex; align-items:center; gap:10px; min-height:56px; padding:8px 28px 8px 2px; border:0; background:none; font:inherit; text-align:left; cursor:pointer; color:var(--ink); width:100%; border-top:1px solid var(--line); }
.v3-frow:first-child{ border-top:0; }
.v3-frow .grow{ flex:1; min-width:0; }
.v3-frow .t{ font-size:15px; font-weight:600; display:block; }
.v3-frow .s{ font-size:12.5px; color:var(--ink-3); display:block; }
.v3-frow .v3-he{ font-size:18px; flex:none; max-width:50%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.v3-frow .ck{ width:18px; color:var(--accent-ink); visibility:hidden; display:inline-flex; flex:none; }
.v3-frow.is-on .t, .v3-frow.is-on .v3-he{ color:var(--accent-ink); }
.v3-frow.is-on .ck{ visibility:visible; }
.v3-az{ position:absolute; right:-6px; top:60px; display:flex; flex-direction:column; align-items:center; font-family:var(--font-he); font-size:12px; color:var(--accent-ink); z-index:3; }
.v3-az button{ background:none; border:0; font:inherit; color:inherit; padding:0 6px; line-height:1.25; cursor:pointer; min-width:24px; }
.v3-menu .v3-group{ margin-bottom:12px; }
.v3-menu .v3-cell .ic{ color:var(--ink-2); }
.v3-menu .v3-seg button{ font-family:var(--font-display); font-weight:700; }

/* ══ Special layouts (6.13) ══ */
/* The Generational Chain as a timeline */
html[data-mode="gc"] #resultsArea{ position:relative; }
.v3-tl{ position:relative; padding-left:28px; }
.v3-tl::before{ content:""; position:absolute; left:9px; top:10px; bottom:0; width:2px; background:var(--line-2); }
.v3-tl-gen{ position:relative; display:flex; align-items:center; gap:10px; margin:6px 0 12px -28px; }
.v3-tl-gen .knot{ width:20px; height:20px; border-radius:10px; background:var(--gilt); box-shadow:0 0 0 4px var(--bg); flex:none; }
.v3-tl-gen .v3-label{ color:var(--gilt-ink); }
#resultsArea .v3-person{ position:relative; overflow:visible !important; }
#resultsArea .v3-person::before{ content:""; position:absolute; left:-23px; top:26px; width:10px; height:10px; border-radius:5px; background:var(--surface); box-shadow:0 0 0 2px var(--line-2); }
.v3-person-h{ display:flex !important; flex-direction:column; gap:4px; padding:14px 16px !important; cursor:pointer; min-height:0 !important; background:none !important; border:0 !important; direction:ltr !important; text-align:left; }
.v3-person-h > :not(.v3-pp){ display:none !important; }
.v3-pp{ display:flex; flex-direction:column; gap:4px; }
.v3-pp .top{ display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.v3-pp .t{ font-weight:700; font-size:16px; color:var(--ink); }
.v3-pp .d{ font-size:13px; color:var(--ink-3); white-space:nowrap; }
.v3-pp .s{ font-size:13.5px; color:var(--ink-2); line-height:1.4; }
.v3-pp .lk{ font-size:13px; font-weight:600; color:var(--accent-ink); }
#resultsArea .v3-person{ margin-bottom:10px !important; border-radius:var(--r-card) !important; box-shadow:var(--shadow-1) !important; }
#resultsArea .v3-person > :not(.v3-person-h){ display:none !important; }
/* The Library (section) as a book grid */
html[data-mode="lib"] #resultsArea .v3-bookgrid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 14px; margin-bottom:22px; }
@media (min-width:600px){ html[data-mode="lib"] #resultsArea .v3-bookgrid{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (min-width:1100px){ html[data-mode="lib"] #resultsArea .v3-bookgrid{ grid-template-columns:repeat(5,minmax(0,1fr)); } }
#resultsArea .v3-bookcell{ background:none !important; box-shadow:none !important; border:0 !important; margin:0 !important; border-radius:0 !important; overflow:visible; }
#resultsArea .v3-bookcell > :not(.v3-bk-h){ display:none !important; }
.v3-bk-h{ display:flex !important; flex-direction:column; gap:8px; cursor:pointer; padding:0 !important; background:none !important; border:0 !important; direction:ltr !important; text-align:left; min-height:0 !important; }
.v3-bk-h > :not(.v3-bk){ display:none !important; }
.v3-bk{ display:flex; flex-direction:column; gap:8px; }
.v3-bk .v3-cover{ height:auto; aspect-ratio:1/1.375; --w:160px; }
.v3-bk .v3-cover .v3-he{ font-size:20px; }
.v3-bk-meta{ display:flex; flex-direction:column; gap:2px; }
.v3-bk-meta .t{ font-weight:700; font-size:14.5px; line-height:1.25; color:var(--ink); }
.v3-bk-meta .s{ font-size:12.5px; color:var(--ink-3); line-height:1.3; }
/* Sefer HaMidos letter rail */
.v3-letter-rail{ position:fixed; right:2px; top:50%; transform:translateY(-50%); z-index:650; display:none; flex-direction:column; align-items:center; font-family:var(--font-he); font-size:12px; color:var(--accent-ink); background:color-mix(in srgb, var(--bg) 70%, transparent); border-radius:12px; padding:4px 0; }
html[data-mode="shm"][data-scr="section"] .v3-letter-rail{ display:flex; }
.v3-letter-rail button{ background:none; border:0; font:inherit; color:inherit; padding:0 8px; line-height:1.3; cursor:pointer; min-height:18px; }
@media (min-width:1100px){ .v3-letter-rail{ right:16px; } }
/* Tikkun Chatzos calculator on the night surface */
#resultsArea .tc-calc.v3c, #resultsArea .tc-calc{ background:var(--night) !important; color:var(--on-night) !important; }
#resultsArea .tc-calc .v3c-en, #resultsArea .tc-calc .v3c-he{ color:var(--on-night) !important; }
#resultsArea .tc-calc .v3c-eb{ color:var(--on-night-2) !important; }
#resultsArea .tc-calc .v3c-tog{ background:rgba(255,255,255,.1); color:var(--on-night); }
#resultsArea .tc-calc .v3c-acts .fav-star, #resultsArea .tc-calc .v3c-acts .share-btn{ color:var(--on-night-2) !important; }
#resultsArea .tc-calc.open > :not(.v3c-h):not(.v3c-acts){ font-family:var(--font-ui) !important; color:var(--on-night) !important; }
#resultsArea .tc-calc input, #resultsArea .tc-calc select{ background:var(--surface-2); color:var(--ink); border:0; border-radius:12px; min-height:44px; font-family:var(--font-ui); font-size:16px; }
#resultsArea .tc-calc .tcc-hero{ background:var(--royal); border-radius:var(--r-card); color:var(--on-royal); }
#resultsArea .tc-calc .tcc-hero-label{ color:var(--gilt); }
#resultsArea .tc-calc .tcc-flag, #resultsArea .tc-calc .tcc-date-note, #resultsArea .tc-calc .tcc-status{ color:var(--on-night-2); }

/* Start Here (6.13): an editorial page, not cards */
#aboutPanel{ padding-top:8px !important; font-family:var(--font-read); color:var(--ink); }
#aboutPanel .ab-wrap{ background:none !important; border:0 !important; box-shadow:none !important; padding:0 !important; max-width:none; }
#aboutPanel .ab-eyebrow{ font-family:var(--font-ui); font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--gilt-ink); background:none; padding:0; display:block; margin-top:8px; }
#aboutPanel .ab-title{ font-family:var(--font-display); font-weight:600; font-size:42px; line-height:1.05; color:var(--ink); margin:8px 0 4px; display:block; }
#aboutPanel .ab-title .he{ display:block; font-family:var(--font-he); color:var(--accent-ink); font-size:30px; margin-top:8px; direction:rtl; text-align:left; font-weight:500; }
#aboutPanel .ab-lede{ font-family:var(--font-read); font-size:18px; line-height:1.6; color:var(--ink); margin:14px 0 4px; }
#aboutPanel .ab-sec h2{ font-family:var(--font-display); font-weight:600; font-size:26px; line-height:1.15; margin:30px 0 10px; color:var(--ink); }
#aboutPanel .ab-sec h3{ font-family:var(--font-display); font-weight:600; font-size:21px; margin:18px 0 8px; color:var(--ink); }
#aboutPanel .ab-sec p{ font-family:var(--font-read); font-size:calc(17px * var(--read-zoom,1)); line-height:1.6; color:var(--ink); }
#aboutPanel .ab-he, #aboutPanel [lang="he"]{ font-family:var(--font-he); }
#aboutPanel .ab-link{ color:var(--accent-ink); cursor:pointer; text-decoration:underline; text-decoration-color:var(--accent-mid); text-underline-offset:3px; }
#aboutPanel .ab-callout{ background:var(--parchment) !important; border:0 !important; border-radius:var(--r-card); padding:4px 18px; }
#aboutPanel .ab-pills{ display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
#aboutPanel .ab-pill{ height:40px; padding:0 14px; border-radius:20px; border:1px solid var(--line-2) !important; background:var(--surface) !important; color:var(--ink) !important; font-family:var(--font-ui); font-size:14px; font-weight:600; cursor:pointer; }
#aboutPanel .ab-note{ font-size:14px !important; color:var(--ink-2) !important; }
#aboutPanel .ab-toc{ display:none !important; }
.v3-onpage{ margin-top:18px; }
.v3-onpage .v3-cell .v3-num{ width:26px; height:26px; font-size:13px; font-family:var(--font-ui); font-weight:700; }
.v3-start-nav{ padding-top:6px; }
/* ══ Bottom sheets (7.2 .sheet) — every v2 and v3 sheet ══ */
.v2-scrim{ background:var(--scrim) !important; z-index:1300 !important; transition:opacity var(--t-med) linear !important; }
.v2-sheet{ z-index:1301 !important; background:var(--surface) !important; border-radius:var(--r-sheet) var(--r-sheet) 0 0 !important; box-shadow:var(--shadow-2) !important; width:min(760px,100%) !important; max-height:92vh !important;
  transition:transform var(--t-sheet) var(--ease-sheet) !important; padding-bottom:0; }
html[data-dark] .v2-sheet{ background:var(--surface-2) !important; }
.v2-sheet.v3-large{ height:92vh; }
.v2-sheet.v3-medium{ min-height:55vh; }
.v2-sheet-handle{ width:40px !important; height:5px !important; border-radius:3px !important; background:var(--line-2) !important; margin:8px auto 0 !important; flex:none; }
.v2-sheet-head{ border-bottom:0 !important; padding:10px var(--gutter) 6px !important; gap:12px !important; align-items:center !important; }
.v2-sheet-head .vs-kicker{ font-size:12px !important; font-weight:700 !important; letter-spacing:.1em !important; color:var(--gilt-ink) !important; }
.v2-sheet-head .vs-kicker:empty{ display:none; }
.v2-sheet-head .vs-title{ font-family:var(--font-display) !important; font-weight:600 !important; font-size:24px !important; line-height:1.2 !important; color:var(--ink) !important; white-space:normal !important; }
.v2-sheet-head .vs-title [lang="he"], .v2-sheet-head .vs-title .v3-he{ font-family:var(--font-he); }
.v2-sheet-head .vs-close{ width:36px !important; height:36px !important; min-width:36px !important; border-radius:18px !important; background:var(--surface-3) !important; color:var(--ink-2) !important; padding:0 !important; flex:none; }
.v2-sheet-head .vs-close svg{ width:16px !important; height:16px !important; }
.v2-sheet-body{ padding:6px var(--gutter) 16px !important; }
.v2-sheet-foot{ border-top:0 !important; background:transparent !important; padding:10px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px)) !important; gap:10px !important; }
.v2-sheet-foot:empty{ display:none !important; }
.v2-sheet-foot .v3-btn{ flex:1; }
.v2-sheet-foot .v3-btn.auto{ flex:none; }
.v2-sheet.v3-sticky-foot .v2-sheet-foot{ position:sticky; bottom:0; }
@media (min-width:600px){
  .v2-sheet{ bottom:auto !important; top:50% !important; width:min(560px, calc(100% - 48px)) !important; max-height:min(86vh, 760px) !important; border-radius:var(--r-sheet) !important;
    transform:translate(-50%,-46%) scale(.98) !important; opacity:0; transition:transform var(--t-sheet) var(--ease-sheet), opacity var(--t-med) var(--ease) !important; }
  .v2-sheet.open{ transform:translate(-50%,-50%) !important; opacity:1; }
  .v2-sheet.v3-large{ height:min(86vh, 760px); }
  .v2-sheet-handle{ display:none; }
  .v2-sheet-foot{ padding-bottom:16px !important; }
}
@media (min-width:1100px){ .v2-sheet{ margin-left:calc(var(--side-w) / 2); } html.reader-open .v2-sheet{ margin-left:calc(var(--side-w) / 2); } }
/* the Filter sheet on wide screens: a 380px popover anchored to the Filter button */
@media (min-width:1100px){
  .v2-sheet.v3-popover{ top:var(--pop-top, 140px) !important; left:var(--pop-left, 50%) !important; width:380px !important; max-height:min(70vh,640px) !important; margin-left:0 !important; transform:translate(0,-6px) !important; border-radius:22px !important; }
  .v2-sheet.v3-popover.open{ transform:none !important; }
  #v3FilterSheetScrim{ background:transparent !important; }
}
/* inspire sheet content */
.inspire-card{ direction:ltr !important; }
.v3-insp-eb{ font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--gilt-ink); }
.v3-insp-he{ font-family:var(--font-he); direction:rtl; text-align:right; font-size:24px; line-height:1.35; margin:14px 0 4px; color:var(--ink); }
.v3-insp-en{ font-family:var(--font-display); font-weight:600; font-size:24px; line-height:1.2; margin:4px 0 12px; color:var(--ink); }
.v3-insp-body{ font-family:var(--font-read); font-size:16.5px; line-height:1.6; color:var(--ink); }
.v3-insp-body.clamp{ max-height:340px; overflow:hidden; -webkit-mask-image:linear-gradient(#000 70%, transparent); mask-image:linear-gradient(#000 70%, transparent); }
.v3-insp-body > *{ margin:0 0 12px; }
.v3-insp-icons{ display:flex; justify-content:center; gap:8px; margin-top:4px; }
/* What's new */
.v3-wn-date{ font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); margin:14px 0 8px; }
.v3-wn ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:12px; }
.v3-wn li{ position:relative; padding-left:18px; font-size:14px; line-height:1.5; color:var(--ink-2); }
.v3-wn li::before{ content:""; position:absolute; left:2px; top:8px; width:7px; height:7px; border-radius:4px; background:var(--accent); }
.v3-wn li strong, .v3-wn li b{ color:var(--ink); font-weight:700; }
/* share sheet (6.11) */
.v3-share-prev{ display:flex; gap:12px; overflow-x:auto; scrollbar-width:none; padding:4px 2px 6px; scroll-snap-type:x mandatory; }
.v3-share-prev::-webkit-scrollbar{ display:none; }
.v3-share-prev button{ flex:none; width:196px; height:245px; border-radius:14px; padding:0; border:0; background:none; cursor:pointer; scroll-snap-align:start; position:relative; overflow:hidden; box-shadow:0 0 0 1px var(--line-2); }
.v3-share-prev button[aria-checked="true"]{ box-shadow:0 0 0 2.5px var(--accent); }
.v3-share-prev img, .v3-share-prev canvas{ width:100%; height:100%; display:block; object-fit:cover; }
.v3-share-prev .v3-skel{ width:100%; height:100%; border-radius:0; }
.v3-share-opts{ display:flex; gap:8px; flex-wrap:wrap; margin:12px 0 4px; }
.v3-share-note{ font-size:12.5px; color:var(--ink-3); margin:6px 2px 0; min-height:0; }
.v3-share-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.share-pop{ display:none !important; }

/* ══ Reader (6.7) ══ */
.reader{ background:var(--rd-bg, var(--bg)) !important; color:var(--rd-ink, var(--ink)); z-index:1100 !important; }
.reader[data-tone="parch"]{ --rd-bg:var(--rd-parch-bg); --rd-ink:var(--rd-parch-ink); --ink:var(--rd-parch-ink); --ink-2:#4A443B; --ink-3:#6B645A; --line:rgba(42,38,32,.1); --line-2:rgba(42,38,32,.18); --bg:var(--rd-parch-bg); --surface:#FBF7EC; --surface-2:#EDE5D2; --surface-3:#E2D8C2; --highlight:#EBD9A6; --gilt-ink:#7A5A1E; --accent-ink:#4527B8; }
.reader[data-tone="night"]{ --rd-bg:var(--rd-night-bg); --rd-ink:var(--rd-night-ink); --ink:var(--rd-night-ink); --ink-2:#CFC8BA; --ink-3:#A9A294; --line:rgba(255,255,255,.1); --line-2:rgba(255,255,255,.18); --bg:var(--rd-night-bg); --surface:#2A292E; --surface-2:#34333A; --surface-3:#403F47; --highlight:#5A4C2C; --gilt-ink:#E3C47E; --accent-ink:#C8BCFF; }
@media (min-width:1100px){ .reader{ left:var(--side-w) !important; } }
.reader .reader-bar{ display:block !important; padding:calc(env(safe-area-inset-top, 0px) + 6px) 12px 0 !important; border-bottom:0 !important; background:color-mix(in srgb, var(--bg) 92%, transparent) !important; min-height:0 !important; -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); }
html.safe-top .reader .reader-bar{ padding-top:calc(var(--sat, 0px) + 6px) !important; }
.v3-rd-top{ display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; gap:8px; }
.v3-rd-top .c{ text-align:center; min-width:0; }
.v3-rd-top .c .t{ font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--ink); }
.v3-rd-top .c .t[dir="rtl"]{ font-family:var(--font-he); font-size:16px; }
.v3-rd-top .c .s{ font-size:12px; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.v3-rd-top .v3-icon-btn{ background:var(--surface-2); box-shadow:none; }
.v3-rd-top .aa{ font-weight:700; font-size:15px; font-family:var(--font-ui); color:var(--ink); }
.v3-rd-top .aa.on{ color:var(--accent-ink); background:var(--accent-soft); }
.reader .reader-back{ display:none !important; }
.reader .rb-mid{ display:block !important; margin:10px 0 0; }
.reader .rb-mid .seg, .reader .v3-rd-seg{ display:grid !important; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); padding:4px; border-radius:14px; background:var(--surface-2) !important; width:100%; max-width:520px; margin:0 auto; }
.reader.no-en .rb-mid{ display:none !important; }
.reader .seg button{ height:38px !important; border-radius:11px !important; min-width:0 !important; font-size:14px !important; font-weight:600 !important; color:var(--ink-2) !important; background:none !important; }
.reader .seg button[aria-pressed="true"]{ background:var(--surface) !important; color:var(--ink) !important; font-weight:700 !important; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.reader .seg button.he-lbl{ font-family:var(--font-he) !important; font-size:15px !important; }
.reader .reader-bar > .icon-btn, .reader .reader-bar [data-fs]{ display:none !important; }
.v3-rd-prog{ height:2px; background:var(--line); margin:12px calc(-12px) 0; position:relative; }
.v3-rd-prog b{ position:absolute; left:0; top:0; bottom:0; width:0; background:var(--gilt-ink); transition:width var(--t-med) var(--ease); }
.reader .reader-main{ background:transparent; scroll-behavior:auto; }
.reader .reader-grid{ display:block !important; max-width:720px !important; margin:0 auto !important; padding:18px var(--gutter) 120px !important; }
.reader .reader-toc{ display:none !important; }
.reader .reader-side{ display:none !important; }
.reader .reader-head{ display:none; }
.reader .reader-head + .reader-body{ margin-top:0; }
.reader article > footer .attrib, .v3-rd-attrib{ font-size:12px !important; color:var(--ink-3) !important; line-height:1.5; margin-top:18px; }
.reader article > footer .attrib .lic{ display:none; }
.reader article > footer .attrib a{ color:var(--accent-ink); }
.reader .r-sec-mark{ flex-direction:row-reverse; margin:22px 0 10px !important; font-size:0 !important; gap:10px !important; color:var(--gilt-ink) !important; }
.reader .r-sec-mark::after{ background:var(--line-2) !important; }
.reader .r-sec-mark .he{ font-size:18px !important; color:var(--gilt-ink) !important; font-family:var(--font-he); }
.reader .r-sec:first-child .r-sec-mark{ margin-top:4px !important; }
.reader .r-seg{ padding:6px 0 !important; border-radius:0 !important; }
.reader .r-seg.is-target{ background:var(--accent-soft) !important; border-radius:10px !important; padding:6px 10px !important; }
.reader .r-he{ font-family:var(--font-he) !important; font-size:var(--rd-he, 23px) !important; line-height:1.85 !important; color:var(--ink) !important; text-wrap:pretty; }
.reader .r-en{ font-family:var(--font-read) !important; font-size:calc(var(--rd-he, 23px) * .74) !important; line-height:1.6 !important; color:var(--ink-2) !important; }
.reader[data-lang="both"] .r-seg{ display:block !important; }
.reader[data-lang="both"] .r-en{ order:0; margin-top:10px !important; }
@media (min-width:1100px){
  .reader[data-lang="both"] .reader-grid{ max-width:1040px !important; padding:24px 64px 140px !important; }
  .reader[data-lang="both"] .r-seg{ display:grid !important; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:48px; align-items:start; }
  .reader[data-lang="both"] .r-en{ order:-1; margin-top:0 !important; font-size:19px !important; }
  .reader[data-lang="both"] .r-he{ font-size:var(--rd-he, 25px) !important; }
}
.reader .cite{ background:var(--highlight); border-radius:4px; padding:0 2px; box-shadow:inset 0 -1.5px 0 var(--gilt-ink); cursor:pointer; color:inherit; font:inherit; border:0; display:inline; line-height:inherit; text-align:inherit; }
.reader .reader-foot{ position:absolute !important; left:0; right:0; bottom:0; display:flex !important; justify-content:space-between !important; align-items:center; padding:10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px)) !important; background:color-mix(in srgb, var(--bg) 90%, transparent) !important; -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); border-top:1px solid var(--line) !important; transition:transform var(--t-med) var(--ease); }
.reader.v3-foot-hide .reader-foot{ transform:translateY(110%); }
.reader .reader-foot .btn-quiet, .reader .reader-foot .btn-primary{ height:44px; border-radius:22px; font-size:15px; font-weight:700; padding:0 18px; display:inline-flex; align-items:center; gap:8px; }
.reader .reader-foot .btn-quiet{ background:transparent !important; border:1px solid var(--line-2) !important; color:var(--ink) !important; font-weight:600; }
.reader .reader-foot .btn-primary{ background:var(--accent-fill) !important; color:var(--on-accent-fill) !important; border:0 !important; }
.reader .reader-foot .btn-primary[disabled]{ opacity:.45; }
.reader .reader-foot .btn-primary span[lang="he"]{ font-family:var(--font-he); }
.reader .reader-error{ color:var(--ink-2); }
.reader .reader-error .btn-primary{ display:inline-flex; height:48px; align-items:center; padding:0 20px; border-radius:24px; background:var(--accent-fill); color:var(--on-accent-fill); text-decoration:none; font-weight:700; }
/* Woven panel beside the reader (>=1360) */
.v3-rd-woven{ display:none; }
@media (min-width:1360px){
  .reader.v3-has-woven .reader-main{ margin-right:340px; }
  .reader.v3-has-woven .reader-bar{ margin-right:340px; }
  .reader.v3-has-woven .reader-foot{ right:340px !important; width:auto !important; }
  .reader.v3-has-woven .v3-rd-woven{ display:flex; flex-direction:column; gap:14px; position:absolute; right:0; top:0; bottom:0; width:340px; overflow-y:auto; padding:24px 20px; border-left:1px solid var(--line); background:var(--surface-2); box-sizing:border-box; }
}
.v3-rd-woven .v3-woven{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.v3-rd-woven .v3-stat{ height:64px; }
.v3-rd-woven .v3-stat b{ font-size:23px; }
/* selection toolbar (desktop) */
.v3-seltool{ position:fixed; z-index:1250; display:none; align-items:center; gap:2px; padding:4px; border-radius:22px; background:var(--ink); color:var(--bg); box-shadow:var(--shadow-2); }
.v3-seltool.show{ display:flex; }
.v3-seltool button{ height:36px; padding:0 12px; border-radius:18px; border:0; background:none; color:inherit; font:inherit; font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.v3-seltool button.gilt{ background:var(--gilt); color:var(--on-gilt); }
/* Aa sheet */
.v3-aa .row{ display:flex; justify-content:space-between; align-items:center; gap:12px; }
.v3-aa input[type=range]{ width:100%; accent-color:var(--accent-fill); height:44px; }
.v3-aa .rng{ display:flex; align-items:center; gap:12px; }
.v3-aa .rng .a1{ font-size:13px; font-weight:700; } .v3-aa .rng .a2{ font-size:22px; font-weight:700; }
.v3-tone{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.v3-tone button{ display:flex; flex-direction:column; align-items:center; gap:8px; background:none; border:0; font:inherit; font-size:13px; font-weight:600; color:var(--ink-2); cursor:pointer; padding:0; }
.v3-tone .sw{ width:100%; height:64px; border-radius:14px; box-shadow:inset 0 0 0 1px var(--line-2); position:relative; }
.v3-tone .sw i{ position:absolute; left:14px; right:14px; height:4px; border-radius:2px; }
.v3-tone .sw i:nth-child(1){ top:18px; width:50%; } .v3-tone .sw i:nth-child(2){ top:30px; } .v3-tone .sw i:nth-child(3){ top:42px; width:70%; }
.v3-tone .sw.app{ background:var(--bg); } .v3-tone .sw.app i{ background:var(--surface-3); }
.v3-tone .sw.parch{ background:#F3ECDC; } .v3-tone .sw.parch i{ background:#D9CDB3; }
.v3-tone .sw.night{ background:#1F1E22; } .v3-tone .sw.night i{ background:#3A3940; }
.v3-tone button[aria-checked="true"] .sw{ box-shadow:inset 0 0 0 2.5px var(--accent); }
.v3-tone button[aria-checked="true"]{ color:var(--accent-ink); }
/* passuk sheet */
.v3-ps-he{ font-family:var(--font-he); direction:rtl; text-align:right; font-size:25px; line-height:1.7; color:var(--ink); margin:6px 0 10px; }
.v3-ps-en{ font-family:var(--font-read); font-size:16px; line-height:1.55; color:var(--ink-2); }
/* Sources sheet text (v2) restyle */
.src-he{ font-family:var(--font-he); font-size:21px; line-height:1.75; color:var(--ink); }
.src-en{ font-family:var(--font-read); font-size:16px; line-height:1.55; color:var(--ink-2); }

/* ══ ⌘K palette (6.16, 8.8) ══ */
.v3-pal-scrim{ position:fixed; inset:0; background:var(--scrim); z-index:1400; display:none; }
.v3-pal{ position:fixed; left:calc(50% + var(--side-w) / 2); top:120px; transform:translateX(-50%); width:min(640px, calc(100% - 48px)); background:var(--surface); border-radius:22px; box-shadow:var(--shadow-2); z-index:1401; overflow:hidden; display:none; direction:ltr; text-align:left; }
html[data-dark] .v3-pal{ background:var(--surface-2); }
html.v3-pal-open .v3-pal, html.v3-pal-open .v3-pal-scrim{ display:block; }
.v3-pal .in{ display:flex; align-items:center; gap:12px; height:62px; padding:0 20px; border-bottom:1px solid var(--line); color:var(--ink-3); }
.v3-pal .in input{ flex:1; border:0; outline:0; background:none; font:inherit; font-size:18px; color:var(--ink); min-width:0; }
.v3-pal .res{ max-height:min(60vh, 520px); overflow-y:auto; }
.v3-pal .grp{ padding:10px 10px 6px; }
.v3-pal .grp > .v3-label{ display:block; padding:2px 12px 6px; }
.v3-pal .it{ display:flex; align-items:center; gap:12px; min-height:48px; padding:0 12px; border-radius:12px; font-size:15px; cursor:pointer; color:var(--ink); border:0; background:none; width:100%; text-align:left; font-family:inherit; }
.v3-pal .it.is-on{ background:var(--accent-soft); }
.v3-pal .it .m{ font-size:13px; color:var(--ink-3); }
.v3-pal .it .v3-he{ margin-left:auto; font-size:16px; color:var(--ink-2); }
.v3-pal .it .ic{ color:var(--ink-3); display:inline-flex; }
.v3-pal .foot{ display:flex; gap:14px; align-items:center; padding:10px 18px; border-top:1px solid var(--line); font-size:12px; color:var(--ink-3); }
.v3-pal .foot span{ display:inline-flex; gap:5px; align-items:center; }
.v3-pal .v3-kbd{ margin:0; }
@media (max-width:1099px){ .v3-pal{ left:50%; top:80px; } }

/* ══ Get the app bar (6.1.1): a floating card above the tab bar ══ */
#appBar{ left:12px !important; right:12px !important; bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px) !important; top:auto !important; width:auto !important; border-radius:18px !important; background:var(--surface) !important; box-shadow:var(--shadow-2) !important; border:0 !important; padding:10px 10px 10px 12px !important; gap:12px !important; align-items:center; direction:ltr; z-index:850 !important; }
html[data-dark] #appBar{ background:var(--surface-2) !important; }
#appBar .ab-icon{ width:40px !important; height:40px !important; border-radius:10px !important; }
#appBar .ab-t{ font-weight:700 !important; font-size:14px !important; color:var(--ink) !important; font-family:var(--font-ui) !important; }
#appBar .ab-t .ab-he{ display:none; }
#appBar .ab-s{ font-size:12px !important; color:var(--ink-3) !important; }
#appBar .ab-get{ height:40px !important; padding:0 18px !important; border-radius:20px !important; background:var(--accent-fill) !important; color:var(--on-accent-fill) !important; font-size:14px !important; font-weight:700 !important; display:inline-flex !important; align-items:center; text-decoration:none; }
#appBar .ab-x{ width:40px !important; height:40px !important; border-radius:20px !important; color:var(--ink-2) !important; background:none !important; font-size:22px !important; }
html.reader-open #appBar, html.v3-sheet-open #appBar{ display:none !important; }

/* ══ Kabbalah book card (section 9) ══ */
#resultsArea .book-card, #resultsArea #kabBookCard{ background:var(--surface) !important; border:0 !important; box-shadow:var(--shadow-1); border-radius:var(--r-card) !important; }
/* ── refinements ── */
.v3-hero-frame{ position:absolute; inset:auto; left:8px; top:8px; width:calc(100% - 16px); height:calc(100% - 16px); overflow:visible; }
.v3-hero-frame rect{ width:calc(100% - 1px); height:calc(100% - 1px); }
@media (min-width:600px) and (max-width:1099px){ html.v3-kb:not([data-scr="search"]) .v3-tabbar{ transform:translate(-50%,110%); } }
html.v3-about #layout{ padding-top:0 !important; }
.v3-start-nav{ display:none; }
html.v3-about[data-scr="section"] .v3-start-nav{ display:grid; }
/* hero rail: room for the shadow so the scroller does not clip it into a visible band */
@media (max-width:599px){ .v3-herorail{ padding-top:16px; padding-bottom:40px; margin-top:2px; margin-bottom:-24px; } .v3-hero{ flex-basis:calc(100% - 44px); } }
@media (min-width:600px){
  .v3-herorail{ margin-bottom:6px; }
  .v3-today-row.nocont{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
html[data-scr="section"] #v3App{ min-height:0; }
/* everything v3 hangs on <body> reads left to right (the page itself is dir=rtl for the old Hebrew-first code) */
.v3-slim, .v3-sheet, .v3-pal, .v3-onpage, .v3-toast, .v3-seltool, .v3-rd-woven, .v3-rd-top{ direction:ltr; }
html body #layout #searchToolbar, html body #layout .search-bar #searchToolbar{ display:none !important; }
html body #layout .search-bar .search-scope-row, html body #layout .search-bar .filters-toggle, html body #layout .search-bar #v2ToolsBtn, html body #layout .search-bar .search-input-wrap{ display:none !important; }
#resultsArea .v3-bk{ width:100%; }
#resultsArea .v3-bk .v3-cover{ width:100%; box-sizing:border-box; }
.v3-tabstrip button[aria-selected="true"]{ color:var(--ink); font-weight:700; }
.v3-tabstrip button[aria-selected="true"]::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:3px; border-radius:2px; background:var(--accent); }
.v3-tabstrip, .v3-seg{ direction:ltr; }
/* Hisbodedus / True Tzaddik: the rich intro is the top block of the first view (no "About" bar) */
#resultsArea > .intro-collapse.v3-keep{ background:none !important; border:0 !important; box-shadow:none !important; padding:0 !important; margin:0 0 16px !important; }
#resultsArea > .intro-collapse.v3-keep > .intro-collapse-bar{ display:none !important; }
#resultsArea > .intro-collapse.v3-keep > .intro-collapse-body{ display:block !important; max-height:none !important; overflow:visible !important; opacity:1 !important; padding:0 !important; }
html body #resultsArea .his-intro{ background:var(--royal) !important; color:var(--on-royal); border-radius:var(--r-card); padding:22px !important; border:0 !important; box-shadow:var(--shadow-hero); }
html body #resultsArea .his-intro-kicker{ color:var(--gilt); font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
html body #resultsArea .his-intro-he{ font-family:var(--font-he); font-size:34px; font-weight:500; color:var(--on-royal); direction:rtl; text-align:right; margin-top:6px; }
html body #resultsArea .his-intro-en{ font-family:var(--font-display); font-size:22px; font-weight:600; color:var(--on-royal); }
html body #resultsArea .his-intro-body, html body #resultsArea .his-intro-body strong{ color:var(--on-royal-2); font-size:15px; line-height:1.6; }
html body #resultsArea .his-intro-body strong{ color:var(--on-royal); }
html body #resultsArea .his-intro-quote, html body #resultsArea .his-intro-cta{ background:var(--royal-track) !important; color:var(--on-royal) !important; border-radius:var(--r-md); }
html body #resultsArea .his-intro-cta strong{ color:var(--gilt); }
@media (max-width:1099px){ html[data-mode="shm"] #resultsArea{ padding-right:42px !important; } }
.v3-stat.is-zero:not([aria-selected="true"]){ opacity:.55; } .v3-stat b .i{ width:22px; height:22px; }
/* lesson lists: Parsha torah rows keep one line (meta left, Hebrew title right) */
.v3-lp-list > .parsha-torah-item{ flex-direction:column-reverse; align-items:flex-end !important; gap:2px !important; position:relative; padding-right:44px !important; }
.v3-lp-list > .parsha-torah-item::after{ position:absolute; right:16px; top:50%; margin:-8px 0 0 !important; }
.v3-lp-list > .parsha-torah-item .torah-title{ text-align:right; max-width:100%; }
/* lesson lists: Likutei Halachos halacha rows (title, count, Read, Sefaria, open arrow) */
#scrLesson .v3-lp-list > .lm-sec{ display:block !important; padding:0 !important; flex-wrap:nowrap; }
#scrLesson .v3-lp-list > .lm-sec > .lm-sec-head{ display:flex !important; align-items:center; gap:8px; min-height:60px; padding:8px 10px 8px 16px !important; background:none !important; border:0 !important; border-radius:0 !important; cursor:pointer; flex-wrap:nowrap; }
#scrLesson .v3-lp-list > .lm-sec > .lm-sec-head:hover{ background:var(--surface-2) !important; }
#scrLesson .v3-lp-list .lm-sec-title{ flex:1; min-width:0; font-family:var(--font-ui) !important; font-size:15.5px !important; font-weight:600 !important; color:var(--ink) !important; letter-spacing:0 !important; text-transform:none !important; line-height:1.3; }
#scrLesson .v3-lp-list .lm-sec-count{ flex:none; min-width:26px; height:26px; padding:0 7px; border-radius:13px; display:inline-flex; align-items:center; justify-content:center; background:var(--surface-2) !important; color:var(--ink-2) !important; border:0 !important; font-size:12.5px !important; font-weight:700; }
#scrLesson .v3-lp-list .lm-sec-head .lmc-actions{ display:flex !important; align-items:center; gap:2px; flex:none; margin:0 !important; }
#scrLesson .v3-lp-list .lm-sec-head .read-btn{ height:36px !important; min-height:36px !important; padding:0 12px !important; font-size:13.5px !important; }
#scrLesson .v3-lp-list .lm-sec-head .sefaria-btn{ min-height:44px; display:inline-flex !important; align-items:center; padding:0 6px !important; font-size:13px !important; color:var(--accent-ink) !important; background:none !important; border:0 !important; }
#scrLesson .v3-lp-list .lm-sec-arrow{ flex:none; width:32px; height:32px; border-radius:16px; display:inline-flex !important; align-items:center; justify-content:center; background:var(--surface-2) !important; color:var(--ink-2) !important; border:0 !important; font-size:12px !important; transition:transform var(--t-med) var(--ease); }
#scrLesson .v3-lp-list > .lm-sec.open > .lm-sec-head .lm-sec-arrow{ transform:rotate(180deg); }
#scrLesson .v3-lp-list > .lm-sec > .lm-sec-body{ padding:0 16px 14px !important; background:none !important; border:0 !important; }
@media (max-width:420px){ #scrLesson .v3-lp-list .lm-sec-head .sefaria-btn{ display:none !important; } }
/* open entries: the old inline-styled labels and tag pills, in the v3 label and tag styles */
.v3c.open > :not(.v3c-h) div[style*="text-transform:uppercase"], .v3c.open > :not(.v3c-h) div[style*="font-style:italic"][style*="ink3"], #inspireSheet div[style*="text-transform:uppercase"]{ font-family:var(--font-ui) !important; font-style:normal !important; font-size:12px !important; font-weight:700 !important; letter-spacing:.1em !important; text-transform:uppercase; color:var(--ink-3) !important; margin:4px 0 8px !important; }
.v3c.open > :not(.v3c-h) span[style*="border-radius:980px"], #inspireSheet span[style*="border-radius:980px"]{ min-height:26px; padding:2px 10px !important; border-radius:13px !important; background:var(--accent-soft) !important; color:var(--accent-ink) !important; border:0 !important; font-family:var(--font-ui) !important; font-size:12px !important; font-weight:600; margin:0 6px 6px 0 !important; }
.v3c.open > :not(.v3c-h) span.v3-tagf{ cursor:pointer; }
/* lesson lists: nested sections and Hebrew meta that must read right to left */
#scrLesson .lm-sec .lm-sec .lm-sec-head{ background:var(--surface-2) !important; border-radius:12px !important; border:0 !important; }
#scrLesson .lm-sec.open > .lm-sec-head{ background:none !important; }
.v3-lp-list .torah-combined, .v3-lp-list .halacha-source-badge{ direction:rtl; unicode-bidi:isolate; }
.v3-lp-list .torah-title{ white-space:normal !important; overflow-wrap:anywhere; }
/* search: one clear button (ours), no inner focus outline (the field draws the ring) */
.v3-field input::-webkit-search-cancel-button, .v3-field input::-webkit-search-decoration{ -webkit-appearance:none; appearance:none; display:none; }
.v3-field input:focus, .v3-field input:focus-visible{ outline:none !important; box-shadow:none !important; }
.v3-best mark{ background:var(--gilt) !important; color:var(--on-gilt) !important; border-radius:3px; padding:0 2px; }
html mark, html[data-dark] mark, html .v3-mark{ background:var(--highlight) !important; color:inherit; }
/* woven pane: sources wrap inside the 340px column */
.v3-rd-woven .src-cat{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.v3-rd-woven .src-chips{ display:flex; flex-wrap:wrap; gap:6px; max-width:100%; }
.v3-rd-woven .source-chip{ max-width:100%; white-space:normal; }
.v3-rd-woven .src-cat-label{ width:auto !important; height:auto !important; min-height:0 !important; flex:none !important; line-height:1.4 !important; padding:0 !important; margin:0 !important; text-align:left !important; }
.v3-swipe:not(.is-swiping) .v3-swipe-del{ visibility:hidden; }
.v3-lrow .grow{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.v3-lrow .grow .t{ font-size:16px; font-weight:600; color:var(--ink); line-height:1.3; }
.v3-lrow .grow .s{ font-size:12.5px; color:var(--ink-3); line-height:1.35; }
.v3-pal input:focus, .v3-pal input:focus-visible{ outline:none !important; box-shadow:none !important; }
#resultsArea .halacha-section-heading{ font-family:var(--font-he) !important; font-size:15px !important; font-weight:500 !important; letter-spacing:0 !important; text-transform:none !important; color:var(--gilt-ink) !important; }
#resultsArea .halacha-section-heading > span{ font-family:var(--font-ui) !important; font-size:12px !important; font-weight:700 !important; letter-spacing:.1em !important; text-transform:uppercase; opacity:1 !important; color:var(--ink-3) !important; }
/* 44px hit areas around controls the spec draws smaller (chips 36, close 36, clear 32) */
.v3-chip, .v3-close, .v3-clear, #scrLesson .v3-lp-list .lm-sec-head .read-btn{ position:relative; }
.v3-chip::after{ content:""; position:absolute; left:0; right:0; top:-4px; bottom:-4px; }
.v3-close::after{ content:""; position:absolute; inset:-4px; }
.v3-clear::after{ content:""; position:absolute; inset:-6px; }
#scrLesson .v3-lp-list .lm-sec-head .read-btn::after{ content:""; position:absolute; left:0; right:0; top:-4px; bottom:-4px; }
.v3-sec-head .prog{ padding:8px 0 !important; margin-top:0 !important; }
/* ── "Woven through the Otzar" panels: the old lists as v3 grouped rows ── */
.v3-woven-panel > .topics-label{ display:block; font-family:var(--font-ui) !important; font-size:12px !important; font-weight:700 !important; letter-spacing:.1em !important; text-transform:uppercase; color:var(--ink-3) !important; margin:4px 4px 8px !important; background:none !important; padding:0 !important; }
.v3-woven-panel .halachos-list, .v3-woven-panel > .topics-row, .v3-woven-panel .lm-sec-body > .topics-row{ display:flex !important; flex-direction:column; background:var(--surface) !important; border-radius:var(--r-card); box-shadow:var(--shadow-1); overflow:hidden; padding:0 !important; margin:0 0 12px !important; border:0 !important; gap:0 !important; }
.v3-woven-panel .halacha-group-label{ font-family:var(--font-he); font-size:14px; color:var(--gilt-ink); text-align:right; padding:12px 16px 2px; background:none !important; border:0 !important; }
.v3-woven-panel .halacha-item{ display:flex !important; align-items:center; gap:10px; min-height:56px; padding:10px 16px !important; margin:0 !important; background:none !important; border:0 !important; border-radius:0 !important; cursor:pointer; direction:ltr; }
.v3-woven-panel .halacha-item + .halacha-item{ border-top:1px solid var(--line) !important; }
.v3-woven-panel .halacha-item:hover, .v3-woven-panel .topic-chip:hover{ background:var(--surface-2) !important; }
.v3-woven-panel .halacha-item .section-pill{ display:none !important; }
.v3-woven-panel .halacha-item .chelek-badge{ flex:none; width:30px; height:30px; border-radius:15px; display:inline-flex !important; align-items:center; justify-content:center; background:var(--parchment) !important; color:var(--gilt-ink) !important; font-family:var(--font-he); font-size:15px !important; border:0 !important; padding:0 !important; }
.v3-woven-panel .halacha-item .halacha-text{ flex:1; min-width:0; font-family:var(--font-he); font-size:17px; color:var(--ink); direction:rtl; text-align:right; unicode-bidi:isolate; }
.v3-woven-panel .halacha-item::after, .v3-woven-panel .topic-chip::after{ content:""; flex:none; width:16px; height:16px; background:var(--ink-3); -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
.v3-woven-panel .topic-chip{ display:grid !important; grid-template-columns:minmax(0,1fr) auto 16px; grid-template-areas:"tl he ch" "mn he ch"; column-gap:12px; row-gap:2px; align-items:center; min-height:56px; padding:10px 16px !important; margin:0 !important; background:none !important; border:0 !important; border-radius:0 !important; cursor:pointer; direction:ltr; text-align:left; height:auto !important; }
.v3-woven-panel .topic-chip + .topic-chip{ border-top:1px solid var(--line) !important; }
.v3-woven-panel .topic-chip .topic-he{ grid-area:he; font-family:var(--font-he); font-size:18px; color:var(--ink); direction:rtl; text-align:right; }
.v3-woven-panel .topic-chip .topic-tl{ grid-area:tl; font-size:15px; font-weight:600; color:var(--ink); }
.v3-woven-panel .topic-chip .topic-meaning{ grid-area:mn; font-size:12.5px; color:var(--ink-3); }
.v3-woven-panel .topic-chip::after{ grid-area:ch; }
.v3-woven-panel .topic-chip > span[style*="opacity"]{ display:none !important; }
/* the "More" panel: each kind is a collapsible row, as on the Likutei Halachos page */
.v3-woven-panel > .lm-sec{ background:var(--surface) !important; border-radius:var(--r-card); box-shadow:var(--shadow-1); margin:0 0 10px !important; border:0 !important; padding:0 !important; overflow:hidden; }
.v3-woven-panel > .lm-sec > .lm-sec-head{ display:flex !important; align-items:center; gap:8px; min-height:56px; padding:8px 12px 8px 16px !important; background:none !important; border:0 !important; cursor:pointer; }
.v3-woven-panel > .lm-sec .lm-sec-title{ flex:1; min-width:0; font-family:var(--font-ui) !important; font-size:15.5px !important; font-weight:600 !important; color:var(--ink) !important; letter-spacing:0 !important; text-transform:none !important; }
.v3-woven-panel > .lm-sec .lm-sec-count{ min-width:26px; height:26px; padding:0 7px; border-radius:13px; display:inline-flex; align-items:center; justify-content:center; background:var(--surface-2) !important; color:var(--ink-2) !important; border:0 !important; font-size:12.5px !important; font-weight:700; }
.v3-woven-panel > .lm-sec .lm-sec-arrow{ width:32px; height:32px; border-radius:16px; display:inline-flex !important; align-items:center; justify-content:center; background:var(--surface-2) !important; color:var(--ink-2) !important; font-size:12px !important; transition:transform var(--t-med) var(--ease); }
.v3-woven-panel > .lm-sec.open .lm-sec-arrow{ transform:rotate(180deg); }
.v3-woven-panel > .lm-sec > .lm-sec-body{ padding:0 !important; border:0 !important; background:none !important; }
.v3-woven-panel > .lm-sec > .lm-sec-body > .topics-row{ box-shadow:none !important; border-radius:0; border-top:1px solid var(--line) !important; margin:0 !important; }
.v3-woven-panel .topic-chip .topic-tl{ color:var(--ink) !important; }
.v3-woven-panel .topic-chip .topic-he{ color:var(--ink) !important; }
.v3-woven-panel .lm-sec .lm-sec-arrow{ border:0 !important; box-shadow:none !important; }
#aboutPanel .ab-eyebrow{ border:0 !important; background:none !important; padding:0 !important; border-radius:0 !important; box-shadow:none !important; }
#scrPage .info-card-head{ background:var(--royal) !important; color:var(--on-royal) !important; border-radius:var(--r-card) !important; box-shadow:var(--shadow-hero); position:relative; }
#scrPage .info-card-head::before{ content:""; position:absolute; inset:8px; border:1px solid var(--gilt-frame); border-radius:14px; pointer-events:none; }
#scrPage .info-card-head .v3-page-title, #scrPage .info-card-head h1, #scrPage .info-card-head h2{ color:var(--on-royal) !important; }
#scrPage .info-card-head .info-tagline{ color:var(--on-royal-2) !important; }
/* Chatzos calculator presets and buttons at v3 size */
#scrPage .tcc-preset, #resultsArea .tcc-preset{ min-height:36px; padding:0 14px !important; border-radius:18px !important; font-size:14px !important; font-weight:600; position:relative; }
#scrPage .tcc-preset::after, #resultsArea .tcc-preset::after{ content:""; position:absolute; left:0; right:0; top:-4px; bottom:-4px; }
#scrPage .tcc-preset.active, #resultsArea .tcc-preset.active{ background:var(--accent-fill) !important; color:var(--on-accent-fill) !important; border-color:transparent !important; }
#scrPage .tcc-btn, #resultsArea .tcc-btn{ min-height:44px !important; padding:0 18px !important; border-radius:22px !important; font-size:14.5px !important; font-weight:700 !important; }
#scrPage .tcc-step, #resultsArea .tcc-step, #scrPage .tcc-date, #resultsArea .tcc-date{ min-height:44px !important; }
#scrPage .tcc-step, #resultsArea .tcc-step{ min-width:44px !important; }
#scrPage .tcc-adv-toggle, #resultsArea .tcc-adv-toggle{ min-height:44px !important; font-size:14px !important; }
.v3-hero button.v3-hero-tap{ z-index:2; }
/* Inspire: a card's body is always shown (some sections hide it until the card is opened) */
#inspireSheet .v3-insp-body > [class$="-body"], #inspireSheet .v3-insp-body > .entry-body{ display:block !important; }
/* view strips and chip rows scroll sideways only (the 44px hit areas must not make them scroll up and down) */
.v3-chips, .v3-tabstrip, .v3-seg, #v3Quick, #v3ViewHost{ overflow-y:hidden !important; overscroll-behavior-y:none; }
.v3-chips, .v3-tabstrip{ overscroll-behavior-x:contain; }
.v3-chips{ padding-top:4px; padding-bottom:4px; }
.v3-tabstrip button.is-on::after, .v3-tabstrip button[aria-selected="true"]::after{ bottom:0; }
/* Woven tiles: more than four wrap onto a second row; long names (Anatomy of the Soul) wrap inside the tile */
.v3-woven{ grid-auto-rows:minmax(72px, auto); }
.v3-stat{ height:auto !important; min-height:72px; padding:8px 4px !important; }
.v3-stat span{ white-space:normal !important; text-align:center; line-height:1.2; overflow:visible !important; }
.v3-stat b .i{ width:24px; height:24px; }
/* "More" works inside a woven panel: their rows in the same grouped style */
.v3-woven-panel > .halachos-list{ display:flex !important; flex-direction:column; background:var(--surface) !important; border-radius:var(--r-card); box-shadow:var(--shadow-1); overflow:hidden; padding:0 !important; margin:0 0 12px !important; }
.v3-woven-panel .halacha-source-item, .v3-woven-panel .halachos-list > .halacha-source{ display:flex !important; flex-direction:column; align-items:flex-start; gap:4px; padding:12px 16px !important; margin:0 !important; background:none !important; border:0 !important; border-radius:0 !important; direction:ltr; }
.v3-woven-panel .halacha-source-item + .halacha-source-item{ border-top:1px solid var(--line) !important; }
.v3-woven-panel .halacha-source-badge{ background:var(--accent-soft) !important; color:var(--accent-ink) !important; border:0 !important; border-radius:13px !important; padding:3px 10px !important; font-family:var(--font-he); font-size:13px !important; cursor:pointer; direction:rtl; unicode-bidi:isolate; }
.v3-woven-panel .halacha-source-title{ font-family:var(--font-he); font-size:17px; line-height:1.45; color:var(--ink); }
.v3-woven-panel .halacha-source-title span{ font-family:var(--font-ui); font-size:14px; color:var(--ink-2) !important; }
.v3-woven-panel .halachos-list > .halacha-source{ font-size:15px; font-weight:600; color:var(--accent-ink); cursor:pointer; }
.v3-woven-panel > div[style*="padding:0.25rem 1.2rem"]{ background:var(--surface); border-radius:var(--r-card); box-shadow:var(--shadow-1); padding:16px !important; font-family:var(--font-read); font-size:16px !important; line-height:1.6 !important; }
.v3-woven-panel > .soc-section-wrap{ border-radius:var(--r-card); overflow:hidden; }
@media (max-width:599px){ .v3-woven.many{ grid-template-columns:repeat(3,minmax(0,1fr)) !important; } }
.v3-rd-woven .v3-woven.many{ grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
/* v2 gave some header children an explicit CSS order (Hisbodedus put the title last); v3 lays the header out itself */
.v3c > .v3c-h > *, .v3l > .v3l-h > *, .v3-person-h > *, .v3-bk-h > *{ order:0 !important; }
/* an empty "Likutei Halachos" block (heading + "No Likutei Halachos cross-reference") is left out of cards (audit S11) */
.v3c .no-lh-note, #inspireSheet .no-lh-note{ display:none !important; }
.v3c .topics-label:has(+ .no-lh-note), #inspireSheet .topics-label:has(+ .no-lh-note){ display:none !important; }
/* search result cards: source, then the English title, then the Hebrew title, all on their own lines (audit B11) */
.v3-line .top{ display:block !important; font-size:12.5px; color:var(--ink-3); }
.v3-line > .t{ font-size:15.5px; font-weight:600; color:var(--ink); line-height:1.3; text-align:left; }
.v3-line > .he{ font-family:var(--font-he); font-size:17px; color:var(--ink); text-align:right; direction:rtl; line-height:1.35; }
.v3-browse{ margin-top:8px; }
.v3-browse-g{ margin:10px 0 14px; }
.v3-browse-h{ font-family:var(--font-display); font-size:19px; font-weight:600; color:var(--ink); margin:0 2px 8px; }
.v3-browse .v3-try{ display:flex; flex-wrap:wrap; gap:8px; }
html mark, html .v3-mark{ padding:0 1px !important; margin:0 -1px; border-radius:3px; }
/* Hebrew card kickers sit on the right, above the right-aligned Hebrew title (audit B4) */
.v3c-tt > .v3c-eb.is-he{ text-align:right !important; direction:rtl !important; font-family:var(--font-he) !important; font-size:13.5px !important; }
/* Likutei Halachos group headings: ORACH CHAIM I on the left, אורח חיים חלק א on the right (audit B5) */
#resultsArea .halacha-section-heading.v3-gh{ display:flex !important; align-items:baseline; justify-content:space-between; gap:12px; direction:ltr !important; }
#resultsArea .halacha-section-heading.v3-gh .en{ font-family:var(--font-ui); font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); }
#resultsArea .halacha-section-heading.v3-gh .he{ font-family:var(--font-he) !important; font-size:15px !important; font-weight:500 !important; letter-spacing:0 !important; text-transform:none !important; color:var(--gilt-ink) !important; margin-left:auto; text-align:right; }
/* chip rows (audit B12): on a wide screen they wrap; on a phone a soft fade at the edge says there is more to scroll */
@media (min-width:1024px){
  .v3-secbar .v3-chips, #scrSearch .v3-chips{ flex-wrap:wrap; overflow:visible !important; white-space:normal; margin:0 !important; padding:4px 0 !important; row-gap:8px; }
}
@media (max-width:1023px){
  .v3-chips.v3-more, .v3-tabstrip.v3-more{ -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image:linear-gradient(to right, #000 calc(100% - 36px), transparent); }
}
/* Sefer HaMidos letter rail (audit B17): taller letters, and a finger can slide down it like the Contacts index */
.v3-letter-rail{ padding:6px 0 !important; touch-action:none; }
.v3-letter-rail button{ min-height:min(26px, calc((100vh - 220px) / 22)) !important; min-width:34px !important; font-size:13.5px !important; display:flex; align-items:center; justify-content:center; }
@media (min-width:600px){ .v3-sec-head .sub{ -webkit-line-clamp:3; } }
/* sidebar (audit S7): a little wider, and every entry stays on one line */
@media (min-width:1100px){ :root{ --side-w:288px; } }
.v3-shelf-i, .v3-sub-i, .v3-nav-i{ white-space:nowrap; }
.v3-sub-i > span{ min-width:0; overflow:hidden; text-overflow:ellipsis; }
.v3-sub-i > [lang="he"], .v3-sub-i > .v3-he{ flex:none; }
/* Hebrew-only rows read right to left: the badge on the right, the chevron on the left pointing left (audit S8) */
.v3-woven-panel .halacha-item{ direction:rtl !important; }
.v3-woven-panel .halacha-item::after{ transform:scaleX(-1); }
.v3-lp-list > .parsha-torah-item{ padding-right:16px !important; padding-left:44px !important; }
.v3-lp-list > .parsha-torah-item::after{ right:auto !important; left:16px; transform:scaleX(-1); }
/* list rows: a long Hebrew title wraps onto a second line instead of being cut (audit S9) */
.v3l-he{ white-space:normal !important; display:-webkit-box !important; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-align:right; max-width:52% !important; flex:0 1 auto !important; }
/* Read buttons for the Wikisource books (Alim LeTerufah, Meshivas Nefesh, Hishtapchus HaNefesh) */
.ws-read-row{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; direction:ltr; }
.mn-pdf-row{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }

