:root{
 /* palette 2: Burgundy & gold on parchment */
 --hd1:#3d0b17; --hd2:#64192b; --hdtx:#ffffff; --navy:#5a1426; --navy2:#74213a; --gold:#cfa653; --gold2:#f0d79c; --title:#7a5713; --ink:#664610; --muted:#6e604c; --link:#80601a; --bg:#f5ecd9; --card:#fffbf2; --line:#e6d8bb; --hsub:#e6cfc0; --srch:#fffbf2; --dsub:#e3cdbd; --notebg:#fbf0d6; --noteln:#e2c98d; --notetx:#5f4510; --press:#f7eedb; --tint:#f1e5cb; --tinttx:#604610; --seg:#eadcbf; --plbg:#4a1020; --pltx:#ffffff; --navbg:#fffbf2; --shd:rgba(61,11,23,.30); --goldsoft:rgba(207,166,83,.14); --goldsoft2:rgba(207,166,83,.20); --z1:#6b1e30; --z2:#43101c; --zln:#c29a48; --zshd:rgba(61,11,23,.30); --ztx:#f4e2bf; --sub2:#7d3a1e; --pbd:#c29a48; --pbg1:#fffaf0; --pbg2:#f3e2bf; --ptx:#4f3510; --ph:#76540f; --ongold:#3d0b17; --scrim:rgba(40,8,16,.6);
 --radius:14px; --navh:64px; --playh:0px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:"Noto Sans Hebrew","Arial Hebrew","Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--ink);
 -webkit-text-size-adjust:100%;padding-bottom:calc(var(--navh) + var(--playh) + env(safe-area-inset-bottom) + 16px);overflow-x:hidden}
body.has-player{--playh:92px}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px;border-radius:8px}

.top{background:linear-gradient(160deg,var(--hd1),var(--hd2));color:var(--hdtx);padding:14px 16px 18px;position:sticky;top:0;z-index:20;box-shadow:0 2px 12px var(--shd)}
.top-inner{max-width:760px;margin:0 auto}
.brand-row{display:flex;align-items:center;gap:10px}
.brand{font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-size:28px;font-weight:700;letter-spacing:.5px;color:var(--gold2)}
.sample-badge{font-size:12px;border:1px solid var(--gold);color:var(--gold2);padding:2px 8px;border-radius:99px}
.hdate{font-size:14px;color:var(--hsub);margin:4px 0 12px}
.search{display:flex;align-items:center;background:var(--srch);border-radius:12px;padding:0 12px;height:46px;gap:8px}
.search svg{width:20px;height:20px;fill:none;stroke:var(--muted);stroke-width:2;flex:none}
.search input{border:0;outline:0;flex:1;min-width:0;font:inherit;font-size:16px;color:var(--ink);background:transparent;height:100%}
.search:focus-within{box-shadow:0 0 0 3px var(--gold)}

main{max-width:760px;margin:0 auto;padding:6px 16px 0}
.note{background:var(--notebg);border:1px solid var(--noteln);color:var(--notetx);border-radius:12px;padding:10px 12px;font-size:13.5px;margin:14px 0 4px;line-height:1.5}
.sec-head{display:flex;align-items:baseline;justify-content:space-between;margin:22px 2px 10px}
.sec-head h2{margin:0;font-size:19px;color:var(--title);position:relative;padding-inline-start:12px}
.sec-head h2::before{content:"";position:absolute;inset-inline-start:0;top:3px;bottom:3px;width:4px;border-radius:4px;background:var(--gold)}
.sec-head a{font-size:14px;color:var(--link)}
.page-title{margin:18px 2px 4px;font-size:23px;color:var(--title)}
.page-sub{margin:0 2px 8px;color:var(--muted);font-size:14px}
.back{display:inline-flex;align-items:center;gap:4px;margin-top:14px;color:var(--link);font-size:14px}

.cats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.cat{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px;min-height:86px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}
.cat::after{content:"";position:absolute;inset-inline-end:-18px;bottom:-18px;width:64px;height:64px;border-radius:50%;background:var(--goldsoft)}
.cat b{font-size:17px;color:var(--title)}
.cat small{color:var(--muted);font-size:12.5px}
.cat .cnt{font-size:12px;color:var(--link);margin-top:6px}
.cat.all{background:var(--navy);border-color:var(--title)}
.cat.all b{color:var(--gold2)} .cat.all small,.cat.all .cnt{color:var(--dsub)}

.list{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);width:100%;background:none;border-inline:0;border-top:0;text-align:start;cursor:pointer}
.item:last-child{border-bottom:0}
.item:active{background:var(--press)}
.item .play-dot{flex:none;width:38px;height:38px;border-radius:50%;background:var(--navy);display:grid;place-items:center}
.item .play-dot svg{width:16px;height:16px;fill:var(--gold2);margin-left:3px}
.item.playing .play-dot{background:var(--gold)} .item.playing .play-dot svg{fill:var(--navy)}
.item .meta{flex:1;min-width:0}
.item .t{font-size:15.5px;font-weight:600;line-height:1.35;color:var(--ink)}
.item .s{font-size:12.5px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item .len{flex:none;font-size:12.5px;color:var(--muted);background:var(--tint);border-radius:8px;padding:3px 7px}
.day-lbl{display:block;font-size:12px;font-weight:700;color:var(--link);letter-spacing:.2px}

.rabbis{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.rabbi{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px 8px;text-align:center}
.avatar{width:60px;height:60px;border-radius:50%;margin:0 auto 8px;display:grid;place-items:center;background:radial-gradient(circle at 30% 30%,var(--navy2),var(--navy));color:var(--gold2);font-family:"Frank Ruhl Libre","Times New Roman",serif;font-size:28px;font-weight:700;border:2px solid var(--gold)}
.rabbi b{display:block;font-size:13.5px;line-height:1.3;color:var(--title)}
.rabbi small{display:block;font-size:11.5px;color:var(--muted);margin-top:3px}

.rabbi-hero{display:flex;gap:14px;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px;margin-top:12px}
.rabbi-hero .avatar{margin:0;width:68px;height:68px;font-size:32px;flex:none}
.rabbi-hero h1{margin:0;font-size:20px;color:var(--title)}
.rabbi-hero p{margin:3px 0 0;color:var(--muted);font-size:13.5px}
.chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.chip{font-size:12px;background:var(--tint);color:var(--tinttx);border-radius:99px;padding:3px 10px}
.week{margin-top:18px}
.week-h{display:flex;justify-content:space-between;align-items:baseline;margin:0 2px 8px}
.week-h h3{margin:0;font-size:17px;color:var(--title)}
.week-h span{font-size:12.5px;color:var(--muted)}
.empty{color:var(--muted);text-align:center;padding:28px 10px;font-size:14px}

.player{position:fixed;inset-inline:0;bottom:calc(var(--navh) + env(safe-area-inset-bottom));background:var(--plbg);color:var(--pltx);z-index:30;box-shadow:0 -4px 16px rgba(0,0,0,.18)}
.p-progress{padding:0 12px;height:14px;display:flex;align-items:center}
.p-progress input{width:100%;margin:0;accent-color:var(--gold);height:4px;direction:rtl}
.p-row{display:flex;align-items:center;gap:10px;padding:2px 12px 10px;max-width:760px;margin:0 auto}
.p-info{flex:1;min-width:0}
.p-title{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.p-sub{font-size:12px;color:var(--dsub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.p-ctrls{display:flex;align-items:center;gap:4px;flex:none;direction:ltr}
.p-btn{width:40px;height:40px;border:0;background:transparent;border-radius:50%;display:grid;place-items:center;cursor:pointer}
.p-btn svg{width:26px;height:26px;fill:none;stroke:var(--pltx);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.p-btn svg text{fill:var(--pltx);stroke:none;font-size:7px;font-family:Arial,sans-serif;font-weight:700}
.p-play{width:46px;height:46px;background:var(--gold)}
.p-play svg{fill:var(--navy);stroke:none;width:22px;height:22px}
.p-play .i-pause{display:none} .player.is-playing .i-play{display:none} .player.is-playing .i-pause{display:block}
.p-speed{border:1px solid var(--gold);background:transparent;color:var(--gold2);border-radius:8px;font-size:12.5px;padding:4px 6px;min-width:46px;cursor:pointer}

.bottom-nav{position:fixed;inset-inline:0;bottom:0;height:calc(var(--navh) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--navbg);border-top:1px solid var(--line);display:flex;z-index:31}
.bottom-nav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11.5px;color:var(--muted)}
.bottom-nav svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
.bottom-nav a.active{color:var(--title);font-weight:700}
.bottom-nav a.active svg{stroke:var(--link)}

.foot{color:var(--muted);font-size:12px;text-align:center;margin:28px 0 8px;line-height:1.6}

@media (min-width:640px){
 .bottom-nav{max-width:760px;margin:0 auto;border-inline:1px solid var(--line);border-radius:14px 14px 0 0}
 .player{max-width:760px;margin:0 auto;border-radius:14px 14px 0 0}
 .cats{grid-template-columns:repeat(3,1fr)}
 .rabbis{grid-template-columns:repeat(4,1fr)}
}

.intro{color:var(--link);font-size:14px;margin:14px 2px 0;line-height:1.5}

/* section tabs: פרשת השבוע | חובת הלבבות */
.seg{display:flex;gap:4px;background:var(--seg);border-radius:12px;padding:4px;margin:14px 0 4px}
.seg a{flex:1 1 auto;min-width:0;text-align:center;padding:9px 6px;border-radius:9px;font-size:15px;font-weight:600;color:var(--tinttx);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seg a.on{background:var(--navy);color:var(--gold2);box-shadow:0 1px 4px var(--shd)}
.rov .week-h h3 a{color:var(--title)}
.rov{scroll-margin-top:170px}

/* shiur row: play button + שיקן / לינק buttons */
.item-row{display:flex;align-items:stretch;border-bottom:1px solid var(--line)}
.item-row:last-child{border-bottom:0}
.item-row .item{border-bottom:0;flex:1;min-width:0;gap:9px;padding-inline-start:12px;padding-inline-end:4px}
.item-row .item .t{font-size:15px;text-wrap:balance}
.item-row .item .len{padding:3px 6px}
.acts{flex:none;display:flex;align-items:center;gap:0;padding-inline-end:4px}
.act{width:40px;min-height:44px;border:0;background:transparent;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;cursor:pointer;color:var(--link);padding:2px 0;-webkit-tap-highlight-color:transparent}
.act svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.act span{font-size:10.5px;line-height:1.1;white-space:nowrap}
.act:active{background:var(--tint)}
.act.busy{opacity:.75;cursor:progress}
.act.busy svg{animation:actpulse 1s ease-in-out infinite}
.act.ready{color:var(--title);background:var(--tint)}
@keyframes actpulse{50%{opacity:.35}}
@media (max-width:360px){.item,.item-row .item{gap:8px;padding-inline:8px}.act{width:38px}}
.toast{position:fixed;left:50%;bottom:calc(var(--navh) + var(--playh) + env(safe-area-inset-bottom) + 14px);transform:translate(-50%,12px);background:var(--plbg);color:var(--pltx);border:1px solid var(--gold);padding:10px 16px;border-radius:12px;font-size:14.5px;z-index:40;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;max-width:calc(100vw - 32px);text-align:center;box-shadow:0 4px 16px rgba(0,0,0,.2)}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* 4 section tabs on a phone: tighter so "חובת הלבבות" fits whole */
@media (max-width:430px){.seg a{padding:9px 4px;font-size:14px}}

/* ---------- זכרו box (home): crown logo, three chabura tiles, the open chabura's lists ---------- */
.zichru{background:linear-gradient(170deg,var(--z1),var(--z2));border-radius:18px;padding:12px 8px 10px;margin:20px -8px 6px;box-shadow:0 3px 14px var(--zshd);border:1px solid var(--zln)}
.zlogo{display:block;width:min(130px,38%);height:auto;margin:-2px auto 10px;border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.35)}
.ztiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ztile{display:flex;flex-direction:column;align-items:center;gap:4px;background:rgba(255,255,255,.06);border:2px solid transparent;border-radius:12px;padding:5px 4px 6px;cursor:pointer;min-height:44px;-webkit-tap-highlight-color:transparent}
.ztile img{display:block;width:68%;margin:0 auto;height:auto;border-radius:8px;aspect-ratio:719/671;object-fit:cover}
.ztile span{font-size:12.5px;color:var(--ztx);font-weight:600}
.ztile.on{border-color:var(--gold2);background:rgba(230,207,154,.18)}
.ztile:active{transform:scale(.98)}
.zhint{text-align:center;color:var(--ztx);font-size:13.5px;margin:10px 0 2px}
.zpanel{background:var(--bg);border-radius:12px;margin:10px -4px 0;padding:2px 3px 6px}
.zcat{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 8px;padding:10px 4px 0}
.zcat b{font-size:17px;color:var(--title)}
.zcat span{font-size:12.5px;color:var(--muted)}
.zpanel .week{margin-top:10px}
.ztitle{margin:2px 0 8px;text-align:center;font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-size:25px;font-weight:700;color:var(--gold2);letter-spacing:.5px}
.timg{display:block;width:min(260px,74%);height:auto;margin:0 auto 4px;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.35);border:2px solid var(--zln)}
.zcat b a{color:var(--title)}
.mas-h{font-weight:700;color:var(--sub2);font-size:15px;padding:8px 4px 2px}
.mas-h small{font-weight:500;color:var(--muted);font-size:12px;margin-inline-start:6px}
.more{display:block;width:100%;margin:8px 0 2px;min-height:44px;border:1px solid var(--line);background:var(--card);border-radius:10px;font-weight:600;color:var(--title);cursor:pointer}
.torah + .zbox{margin-top:16px}
.ztiles.n2{grid-template-columns:repeat(2,minmax(0,1fr))}
.ztile.txt{justify-content:center;min-height:74px;background:rgba(255,248,232,.10);border-color:rgba(230,207,154,.35)}
.ztile.txt b{font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-size:24px;color:var(--gold2);line-height:1.1}
.box-tiles .timg + .ztiles{margin-top:10px}
.soon{text-align:center;color:var(--muted);font-size:14px;padding:14px 6px 10px}
.zichru + .zichru{margin-top:16px}
#zpanel .week .list{margin-inline:-4px}

/* top row: זכרו and תורה שבכתב side by side (S, Oct 25); an opened tile makes the row stack full width */
.toprow{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:stretch;margin:14px -8px 6px}
.toprow>section{margin:0!important;min-width:0}
.toprow:has(.ztile.on){grid-template-columns:1fr}
.toprow .timg{max-width:100%;height:auto}
.toprow .ztiles{gap:4px}
.toprow .ztile{padding:4px 2px 5px}
.toprow .ztile span{font-size:10.5px;white-space:nowrap}
.toprow .ztile.txt{min-height:56px}
.toprow .ztile.txt b{font-size:17px}
.toprow .ztile.txt span{white-space:normal;font-size:10px;line-height:1.15;text-align:center}

/* ---------- פרישע שיעורים column (S, Oct 25) ----------
   phone: the two compact lists come right under the boxes (DOM order: boxes, column, the rest);
   ≥900px: the home page widens and the column stands on the visual LEFT (the page is RTL, so the 2nd grid column), sticky while scrolling. */
.freshcol{margin:18px 0 4px;display:flex;flex-direction:column;gap:14px}
.fcol .fhead{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:0 8px;margin:0 2px 6px}
.fcol .fhead h2{margin:0;font-size:17px;color:var(--title);position:relative;padding-inline-start:10px}
.fcol .fhead h2::before{content:"";position:absolute;inset-inline-start:0;top:3px;bottom:3px;width:4px;border-radius:4px;background:var(--gold)}
.fcol .fhead span{font-size:11.5px;color:var(--muted)}
#fresh-11 .flist{border-color:var(--gold);box-shadow:0 1px 8px var(--goldsoft2)}
.item-row.compact .item{padding:7px 4px 7px 2px;padding-inline-start:8px;gap:7px}
.item-row.compact .item .play-dot{width:28px;height:28px}
.item-row.compact .item .play-dot svg{width:12px;height:12px;margin-left:2px}
.item-row.compact .item .t{font-size:13.5px;line-height:1.3;font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-wrap:pretty}
.item-row.compact .item .s{font-size:11.5px;margin-top:1px}
.item-row.compact .item .len{font-size:11px;padding:2px 5px}
.item-row.compact .acts{padding-inline-end:2px}
.item-row.compact .act{width:30px;min-height:36px}
.item-row.compact .act svg{width:16px;height:16px}
.item-row.compact .act span{display:none}
@media (min-width:900px){
 main:has(.homegrid){max-width:1140px}
 .homegrid{display:grid;grid-template-columns:minmax(0,1fr) 300px;grid-template-rows:auto 1fr;grid-template-areas:"main fresh" "rest fresh";column-gap:22px}
 .hg-main{grid-area:main;min-width:0}
 .hg-rest{grid-area:rest;min-width:0}
 .freshcol{grid-area:fresh;align-self:start;position:sticky;top:150px;margin-top:14px;max-height:calc(100vh - 150px - var(--navh) - var(--playh) - 16px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-bottom:4px}
}

/* פרנס לחודש (S, Oct 25) */
.parnes{margin:12px 0;padding:12px 16px;text-align:center;border:2px solid var(--pbd);border-radius:12px;background:linear-gradient(var(--pbg1),var(--pbg2));color:var(--ptx)}
.parnes h3{margin:0 0 6px;font-size:1.25em;color:var(--ph)}
.parnes p{margin:2px 0;font-size:1em;line-height:1.5}
.parnes p:first-of-type{font-weight:700;font-size:1.08em}

/* TelTech tiles (חומש רש״י): collapsible מגיד שיעור → ספר groups */
.ttg{background:var(--card);border:1px solid var(--line);border-radius:12px;margin:10px 0 0;overflow:hidden}
.ttg>summary,.tts>summary{display:flex;align-items:baseline;justify-content:space-between;gap:8px;cursor:pointer;list-style:none;padding:12px 12px;min-height:44px;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.ttg>summary::-webkit-details-marker,.tts>summary::-webkit-details-marker{display:none}
.ttg>summary b{font-size:17px;color:var(--title)}
.tts>summary b{font-size:15.5px;color:var(--sub2)}
.ttg>summary span,.tts>summary span{font-size:12.5px;color:var(--muted);white-space:nowrap}
.ttg>summary b::before,.tts>summary b::before{content:"‹";display:inline-block;margin-inline-end:8px;color:var(--muted);transition:transform .15s}
.ttg[open]>summary b::before,.tts[open]>summary b::before{transform:rotate(-90deg)}
.tts{border-top:1px solid var(--line)}
.tts>summary{padding:10px 12px 10px 12px;padding-inline-start:22px}
.tts .list{border-radius:0;border-inline:0;border-bottom:0;margin:0}
.tts .mas-h{padding-inline-start:12px}


/* chabura opens as its own page (S, Oct 25 2:13 PM) */
.zpage-top{margin:10px 0 4px}
.zback{display:inline-block;padding:8px 12px;border-radius:10px;background:var(--card);border:1px solid var(--line);text-decoration:none;color:inherit;font-weight:600}
.zpage{width:auto;max-width:900px;margin:0 auto}
.zpage-title{margin:8px 0 2px;font-size:1.5em;text-align:center}
.zpage-desc{margin:0 0 8px;text-align:center;opacity:.75}
.zpage .zpage-title{color:var(--ztx)}
.zpage .zpage-desc{color:var(--ztx)}

/* parnes in a small box on the left side of the blue header (S, Oct 25 2:15 PM) */
.brand-row .parnes-top{margin-inline-start:auto;max-width:48%}
.parnes-top .parnes{margin:0;padding:5px 9px;border-width:1.5px;border-radius:9px;line-height:1.25}
.parnes-top .parnes h3{font-size:12.5px;margin:0 0 1px}
.parnes-top .parnes p{font-size:11px;margin:0;line-height:1.3}
.parnes-top .parnes p:first-of-type{font-size:11.5px}
@media(min-width:700px){.parnes-top .parnes h3{font-size:14px}.parnes-top .parnes p{font-size:12.5px}.parnes-top .parnes p:first-of-type{font-size:13px}}
/* fresh column: שיעורי היום and פרישע as two separate boxes (S, Oct 25 2:16 PM) */
.freshcol .fcol{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px}

/* S, Oct 25 8:19 PM: שיעורי היום and פרישע שיעורים fully separate, each with its own scroll bar */
.freshcol .fcol{display:flex;flex-direction:column;min-height:0}
.freshcol .fcol+.fcol{margin-top:18px}
.freshcol .flist{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;max-height:360px;min-height:0}
@media (min-width:900px){
 .freshcol{overflow:visible;max-height:none;display:flex;flex-direction:column;height:calc(100vh - 150px - var(--navh) - var(--playh) - 16px);padding-bottom:0}
 .freshcol .fcol{flex:1 1 0}
 .freshcol .flist{flex:1 1 auto;max-height:none}
}

/* header title (S, Oct 25 8:24 PM) */
.brand{display:flex;flex-direction:column;line-height:1.1;text-decoration:none}
.brand .brand-s{font-size:13px;font-weight:500;letter-spacing:0;color:var(--gold2);opacity:.85;margin-top:2px}
@media (max-width:600px){.brand{font-size:22px}.brand .brand-s{font-size:11px}}

/* upload button in header (S, Oct 25 8:29 PM) */
.upload-btn{display:inline-block;margin:6px 0 2px;padding:6px 14px;border-radius:999px;background:var(--gold);color:var(--ongold);font-weight:700;font-size:14px;text-decoration:none;box-shadow:0 1px 4px rgba(0,0,0,.2)}
.upload-btn:hover{filter:brightness(1.08)}

/* upload popup (S, Oct 25 8:34 PM) */
.upm{position:fixed;inset:0;z-index:1000;background:var(--scrim);display:flex;align-items:center;justify-content:center;padding:16px}
.upm[hidden]{display:none}
body.upm-open{overflow:hidden}
.upm-box{position:relative;background:var(--card,#fff);color:var(--ink);border-radius:14px;max-width:460px;width:100%;max-height:92vh;overflow-y:auto;padding:18px 18px 14px;box-shadow:0 10px 40px rgba(0,0,0,.35)}
.upm-box h2{margin:0 0 12px;font-size:20px;color:var(--title)}
.upm-x{position:absolute;top:8px;left:10px;border:0;background:none;font-size:26px;cursor:pointer;color:inherit;line-height:1}
.upm form{display:flex;flex-direction:column;gap:10px}
.upm label{display:flex;flex-direction:column;gap:4px;font-size:14px;font-weight:600}
.upm input:not([type=file]){font:inherit;font-weight:400;padding:9px 10px;border:1px solid var(--line,#ccc);border-radius:8px;background:#fff;color:var(--ink)}
.upm-drop{border:2px dashed var(--gold,#c9a45c);border-radius:12px;padding:22px 10px;text-align:center;cursor:pointer;font-weight:700!important;align-items:center}
.upm-drop.over{background:var(--goldsoft2)}
.upm-drop.has{border-style:solid;background:var(--goldsoft)}
.upm-drop small{font-weight:400;opacity:.8}
.upm-more summary{cursor:pointer;font-size:13px;opacity:.85;margin-bottom:6px}
.upm-prog{height:8px;border-radius:4px;background:var(--seg);overflow:hidden}
.upm-prog div{height:100%;width:0;background:var(--gold,#c9a45c);transition:width .2s}
.upm-msg{min-height:1.2em;font-size:14px}
.upm-hint{font-size:13px;color:#666;margin:-4px 0 8px} /* Oct 29 2026: email-or-phone note */
.upm-send{font:inherit;font-weight:700;padding:10px;border:0;border-radius:999px;background:var(--gold,#c9a45c);color:var(--ongold);cursor:pointer}
.upm-send:disabled{opacity:.6}

/* פרשת השבוע live rovs (Oct 26): this week's parsha on top of each rov */
.ttextra{margin-top:6px}
.ttwk>summary{background:color-mix(in srgb,var(--title) 7%,transparent)}
.ttwk>summary b{color:var(--title)}

/* Oct 26: centered fresh-column heads per S's sample */
.fcol .fhead{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:2px;margin:4px 2px 10px}
.fcol .fhead h2{padding-inline-start:0;font-size:19px}
.fcol .fhead h2::before{display:none}
.fcol .fhead span{font-size:13px;font-weight:700;color:var(--title)}

/* חק לישראל (S, Oct 26): today's shiur on top + one box per מגיד שיעור opening his own page */
.ttday{background:var(--card);border:2px solid var(--gold);border-radius:14px;margin:10px 0 4px;padding:8px 6px 6px;box-shadow:0 2px 10px var(--goldsoft2)}
.ttday-h{display:flex;flex-direction:column;align-items:center;gap:2px;padding:2px 6px 6px;border-bottom:1px solid var(--line);margin-bottom:4px}
.ttday-h b{font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-size:21px;color:var(--title);line-height:1.15}
.ttday-h span{font-size:13px;color:var(--sub2);font-weight:600}
.ttday .list{margin-inline:-2px}
.rovboxes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 4px}
.rovbox{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;min-height:118px;padding:14px 10px 12px;border-radius:14px;
 background:linear-gradient(170deg,var(--z1),var(--z2));border:1.5px solid var(--zln);box-shadow:0 3px 12px var(--zshd);color:var(--ztx);-webkit-tap-highlight-color:transparent}
.rovbox b{font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-size:18px;line-height:1.25;color:var(--gold2)}
.rovbox span{font-size:12.5px;font-weight:600;color:var(--ztx)}
.rovbox small{font-size:11.5px;color:var(--ztx);opacity:.8}
.rovbox i{position:absolute;bottom:6px;left:10px;font-style:normal;font-size:20px;color:var(--gold2);opacity:.8}
.rovbox:active{transform:scale(.98)}
.rovbox:hover{border-color:var(--gold2)}
@media (max-width:340px){.rovboxes{grid-template-columns:1fr}}

/* Oct 26: bigger שיעורי היום + day picker */
#fresh-daily .fhead h2{font-size:25px}
.fdaypick{position:relative;display:inline-flex;align-items:center;gap:4px;cursor:pointer;border-bottom:1.5px dashed var(--gold);padding:0 2px 1px}
.fdaypick select{appearance:none;-webkit-appearance:none;background:transparent;border:0;font:inherit;font-size:16px;font-weight:700;color:var(--title);cursor:pointer;text-align:center;padding:2px 0;direction:rtl}
.fdaypick b{font-size:13px;color:var(--gold)}

/* Oct 26: parshiyos collapsible inside a sefer */
.ttp{border-top:1px solid var(--line)}
.ttp>summary{display:flex;align-items:baseline;justify-content:space-between;gap:8px;cursor:pointer;list-style:none;padding:9px 12px;padding-inline-start:34px;min-height:40px;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.ttp>summary::-webkit-details-marker{display:none}
.ttp>summary b{font-size:14.5px;color:var(--title)}
.ttp>summary span{font-size:12px;color:var(--muted);white-space:nowrap}
.ttp>summary b::before{content:"‹";display:inline-block;margin-inline-end:8px;color:var(--muted);transition:transform .15s}
.ttp[open]>summary b::before{transform:rotate(-90deg)}

/* מגידי שיעור shortcuts (Oct 26 2026) */
.mgs .rabbi{display:block;color:inherit;text-decoration:none;cursor:pointer;transition:transform .12s}
.mgs .rabbi:active{transform:scale(.97)}
.mgs .rabbi b{font-size:13px}
.mgs .mg-soon{opacity:.72}
.mgs .mg-soon small{color:var(--gold2,#b8892b);font-weight:600}
.mg-title{text-align:center;margin:8px 0 12px;color:var(--title)}

/* Home top boxes (S, Oct 26, round 2): row of 3 new boxes in the site's own burgundy/gold box style, crown (img/crown.png) on the middle box; the real זכרו + תורה שבכתב boxes (.toprow) sit right under it */
.hometop{margin:14px -8px 8px;display:flex;flex-direction:column}
.hb-logo{display:flex;justify-content:center;margin-bottom:-30px;position:relative;z-index:2;pointer-events:none}
.hb-logo img{width:130px;height:auto;display:block;filter:drop-shadow(0 2px 3px rgba(0,0,0,.25))}
.hb-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.1fr) minmax(0,1fr);gap:8px;align-items:stretch}
.hb{background:linear-gradient(170deg,var(--z1),var(--z2));border:1px solid var(--zln);border-radius:18px;box-shadow:0 3px 14px var(--zshd);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:10px 6px;text-decoration:none;min-width:0;-webkit-tap-highlight-color:transparent}
a.hb:active{transform:scale(.98)}
.hb b{font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-size:clamp(22px,6.6vw,34px);font-weight:700;line-height:1.1;color:var(--gold2);letter-spacing:.5px}
.hb small{font-size:clamp(10.5px,2.8vw,14px);margin-top:5px;color:var(--ztx);font-weight:600}
.hb-small{aspect-ratio:1/1}
.hb-wide{padding:34px 6px 10px}
.hb-first{align-items:end}
.hb-flash{animation:hbflash 1.6s ease}
@keyframes hbflash{0%,60%{box-shadow:0 0 0 4px var(--gold)}100%{box-shadow:none}}
.hometop + .toprow{margin-top:0}
@media(min-width:600px){.hb-row{align-items:stretch}.hb-small{aspect-ratio:auto}.hb-wide{min-height:120px}}
@media(min-width:900px){.hb-logo img{width:150px}.hb-logo{margin-bottom:-36px}.hb-wide{padding-top:44px}}

/* Home top boxes round 3 (S, Oct 26 1:08/1:15 PM): crown smaller; זכרו logo + תורה שבכתב חומש image sit on the top edge of their boxes exactly like the crown — same height (--lg-h), same overlap into the box (--lg-in) */
:root{--lg-h:74px;--lg-in:24px}
@media(min-width:900px){:root{--lg-h:86px;--lg-in:28px}}
.hb-logo{margin-bottom:calc(-1 * var(--lg-in))}
.hb-logo img{width:auto;height:var(--lg-h)}
.hb-wide{padding-top:calc(var(--lg-in) + 8px)}
@media(min-width:900px){.hb-logo img{width:auto}.hb-logo{margin-bottom:calc(-1 * var(--lg-in))}.hb-wide{padding-top:calc(var(--lg-in) + 10px)}}
.toprow{row-gap:calc(var(--lg-h) - var(--lg-in) + 10px)}
.hometop + .toprow,.toprow{margin-top:calc(var(--lg-h) - var(--lg-in) + 10px)}
.toprow>section{position:relative;padding-top:calc(var(--lg-in) + 8px)}
.toprow>section>.zlogo,.toprow>section>.timg{position:absolute;top:calc(var(--lg-in) - var(--lg-h));left:50%;transform:translateX(-50%);height:var(--lg-h);width:auto;max-width:94%;margin:0;z-index:2;border-radius:12px;border:2px solid var(--zln);box-shadow:0 2px 8px rgba(0,0,0,.35)}
.toprow>section>.timg + .ztiles{margin-top:0}
.toprow>section>.ztitle{margin-top:0}

/* Crown outline (S, Oct 26 1:33 PM): light parchment stroke so the crown reads on the red box */
.hb-logo img{filter:drop-shadow(1.5px 0 0 #f6e7c1) drop-shadow(-1.5px 0 0 #f6e7c1) drop-shadow(0 1.5px 0 #f6e7c1) drop-shadow(0 -1.5px 0 #f6e7c1) drop-shadow(0 2px 4px rgba(0,0,0,.45))}

/* Logos like the crown (S, Oct 26 1:44 PM): זכרו logo + חומש are cut-out images, no frame/box, same parchment outline as the crown */
.toprow>section>.zlogo,.toprow>section>.timg{border:0;border-radius:0;box-shadow:none;background:none;filter:drop-shadow(1.5px 0 0 #f6e7c1) drop-shadow(-1.5px 0 0 #f6e7c1) drop-shadow(0 1.5px 0 #f6e7c1) drop-shadow(0 -1.5px 0 #f6e7c1) drop-shadow(0 2px 4px rgba(0,0,0,.45))}

/* header logos split on both sides of the title (S, Oct 26 3:43 PM) */
.hlogos{display:none}
.hlogos-m{display:none}
.hlogo{display:block;width:auto;object-fit:contain;filter:drop-shadow(1px 0 0 rgba(246,231,193,.55)) drop-shadow(-1px 0 0 rgba(246,231,193,.55)) drop-shadow(0 1px 0 rgba(246,231,193,.55)) drop-shadow(0 -1px 0 rgba(246,231,193,.55)) drop-shadow(0 2px 4px rgba(0,0,0,.4))}
@media (min-width:900px){
 .hlogos{display:flex;position:absolute;top:12px;bottom:14px;width:calc((100% - 760px) / 2 - 16px);flex-direction:column;align-items:center;justify-content:space-evenly;gap:4px;pointer-events:none}
 .hl-r{right:8px}.hl-l{left:8px}
 .hlogos .hlogo{height:58px;max-width:100%}
}
@media (min-width:1180px){
 .hlogos{flex-direction:row;justify-content:space-evenly;gap:10px}
 .hlogos .hlogo{height:min(130px,calc((100vw - 760px) / 6 - 26px));max-width:none}
}
@media (max-width:899.98px){
 .hlogos-m{display:flex;justify-content:space-between;align-items:center;margin:-4px 0 8px}
 .hlogos-m span{display:flex;gap:clamp(8px,3.5vw,20px);align-items:center}
 .hlogos-m .hlogo{height:clamp(32px,8.5vw,50px)}
}

/* Jerusalem Rav page: categories as on the Rav's own line (S, Oct 26 2026) */
.ycs-wrap{margin-top:8px}
.yc{background:var(--card);border:1px solid var(--line);border-radius:12px;margin:8px 0 0;overflow:hidden}
.yc>summary{display:flex;align-items:center;gap:10px;cursor:pointer;list-style:none;padding:10px 12px;min-height:48px;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.yc>summary::-webkit-details-marker{display:none}
.yc>summary b{flex:1;font-size:16.5px;color:var(--title);line-height:1.25}
.yc>summary span{font-size:12.5px;color:var(--muted);white-space:nowrap}
.yc>summary span::after{content:"‹";display:inline-block;margin-inline-start:8px;transition:transform .15s}
.yc[open]>summary span::after{transform:rotate(-90deg)}
.ycd{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-weight:700;font-size:15px;background:radial-gradient(circle at 30% 30%,var(--navy2),var(--navy));color:var(--gold2);border:1.5px solid var(--gold)}
.yc:not(.yc-has)>summary .ycd{background:var(--bg);color:var(--muted);border-color:var(--line)}
.yc-has>summary span{color:var(--link);font-weight:700}
.yc-body{border-top:1px solid var(--line);padding:2px 8px 8px}
.yc-body .list{margin:8px 0 0}
.yc-sub{margin:6px 0 0;border-radius:10px;background:var(--bg)}
.yc-sub>summary{min-height:42px;padding:8px 10px}
.yc-sub>summary b{font-size:15px}
.yc-sub .ycd{width:24px;height:24px;font-size:12.5px}
.yc-sub .yc-sub{background:var(--card)}
.yc-none{padding:10px 6px 6px;font-size:13.5px}
.yc-body{padding:2px 5px 6px}.yc-sub .yc-body{padding:2px 2px 4px}.yc-sub .yc-sub>summary{padding:8px 8px}

/* big home headline (S, Oct 26 4:56 PM) */
.hb-headline{text-align:center;margin:6px auto 18px;padding:18px 14px 16px;max-width:900px;background:linear-gradient(170deg,var(--z1),var(--z2));border:1.5px solid var(--zln);border-radius:20px;box-shadow:0 4px 18px var(--zshd);position:relative}
.hb-headline:before{content:"";position:absolute;inset:5px;border:1px solid rgba(207,166,83,.45);border-radius:15px;pointer-events:none}
.hb-headline h1{margin:0;font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-weight:900;font-size:clamp(28px,7.2vw,54px);line-height:1.15;color:var(--gold2);text-shadow:0 2px 4px rgba(0,0,0,.35);letter-spacing:.3px}
.hb-headline p{margin:8px 0 0;font-family:"Frank Ruhl Libre","Times New Roman","David",serif;font-weight:700;font-size:clamp(17px,4.4vw,28px);color:var(--ztx)}
.hb-headline .hb-orn{display:block;width:140px;height:2px;margin:12px auto 0;background:linear-gradient(90deg,transparent,var(--gold),transparent)}

/* headline without box (S, Oct 26 5:01 PM) */
.hb-headline{background:none;border:0;box-shadow:none;padding:10px 8px 6px;margin:4px auto 14px}
.hb-headline:before{display:none}
.hb-headline h1{color:var(--hd2);text-shadow:0 1px 0 rgba(255,255,255,.6)}
.hb-headline p{color:var(--title)}

/* Home round 4 (S, Oct 26 5:29 PM): a 2nd row of home boxes under the first — one red box "דרשות הכנה לחנוכה" (shortcut to the חנוכה שיעורים page). A row with one box spans the row; rows after the first carry no crown, so no crown padding. */
.hb-row.hb-next{margin-top:8px}
.hb-row.hb-one{grid-template-columns:minmax(0,1fr)}
.hb-row.hb-next .hb-wide{padding:14px 8px;min-height:0}
.hb-row.hb-next .hb b{font-size:clamp(22px,6.4vw,32px)}
@media(min-width:600px){.hb-row.hb-next .hb-wide{min-height:84px}}

/* רבינו לדורות column (S, Oct 26 5:31 PM): same look as שיעורים חדשים (.fcol), round gold logo on top.
   phone: right under the שיעורים חדשים column; ≥900px: the home grid gets a 3rd column on the visual RIGHT (RTL: the 1st grid column). */
.rabcol{margin:18px 0 4px}
.rabcol .fcol{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column}
.rabcol .fhead{flex-direction:column;align-items:center;text-align:center;justify-content:center}
.rabcol .fhead h2{font-size:25px;padding-inline-start:0}
.rabcol .fhead h2::before{display:none}
.rb-logo{display:flex;justify-content:center;margin:2px 0 8px}
.rb-logo img{width:120px;height:120px;border-radius:50%;object-fit:cover;border:3px solid var(--gold);box-shadow:0 2px 10px rgba(0,0,0,.3);display:block}
.rabcol .flist .empty{text-align:center;color:var(--muted);padding:12px 6px;font-size:14px}
.rabcol .flist{max-height:360px;overflow-y:auto;scrollbar-width:thin}
@media (min-width:900px){
 main:has(.homegrid.has-rab){max-width:1440px}
 .homegrid.has-rab{grid-template-columns:250px minmax(0,1fr) 300px;grid-template-areas:"rab main fresh" "rab rest fresh"}
 .rabcol{grid-area:rab;align-self:start;position:sticky;top:150px;margin-top:14px;max-height:calc(100vh - 150px - var(--navh) - var(--playh) - 16px);overflow-y:auto;scrollbar-width:thin}
 .rabcol .flist{max-height:none}
}

/* זכרו ש״ס/הלכה live maggidim (Oct 26 2026) */
.zextra{margin:4px 0 14px;padding-bottom:12px;border-bottom:1px solid rgba(160,120,40,.35)}
.zextra .rovboxes{margin-top:8px}

/* Oct 26 2026 (S 6:38 PM): פארבינד זיך floating button, bottom right, above the bottom nav and the player */
.cfab{position:fixed;right:14px;bottom:calc(var(--navh,0px) + var(--playh,0px) + env(safe-area-inset-bottom) + 14px);width:52px;height:52px;border-radius:50%;border:2px solid var(--gold);background:var(--navy);color:var(--gold2);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:35;box-shadow:0 3px 12px rgba(0,0,0,.3);padding:0}
.cfab svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.cfab:hover{background:var(--navy2)}
#cForm{display:flex;flex-direction:column;gap:10px}
#cForm textarea{font:inherit;resize:vertical}
body.upm-open .cfab{display:none}
.upm textarea{font:inherit;font-weight:400;padding:9px 10px;border:1px solid var(--line,#ccc);border-radius:8px;background:#fff;color:var(--ink)}

/* Oct 27 2026: share-by-email dialog */
.upm-box .sh-t{margin:-4px 0 12px;color:var(--title);font-weight:700;font-size:15px;line-height:1.4}
.upm-box .sh-note{margin:6px 0 4px;font-size:13px;opacity:.8}
#shForm input[type=email]{text-align:left}

/* Oct 27 (S 2:11 PM): the לוח as its own box under the רבינו לדורות box (same .rabcol .fcol card look) */
.rabcol .fcol+.fcol{margin-top:18px}
.luach-img{display:block;width:100%;padding:0;border:1px solid var(--gold);border-radius:8px;background:#fff;cursor:zoom-in;line-height:0;overflow:hidden}
.luach-img img{width:100%;height:auto;display:block}
.luach-dl{display:block;margin-top:10px;background:var(--navy);color:var(--gold2);border:1px solid var(--gold);border-radius:10px;padding:11px 12px;font-size:16px;font-weight:700;text-decoration:none;text-align:center}
.rbzoom{position:fixed;inset:0;z-index:60;background:var(--scrim);display:flex;align-items:center;justify-content:center;padding:14px;cursor:zoom-out}
.rbzoom img{max-width:100%;max-height:100%;border-radius:6px;box-shadow:0 6px 24px rgba(0,0,0,.4);background:#fff}
.rbzoom button{position:absolute;top:calc(10px + env(safe-area-inset-top));inset-inline-end:12px;width:40px;height:40px;border-radius:50%;border:1px solid var(--gold);background:var(--plbg);color:var(--gold2);font-size:18px;cursor:pointer}
/* Oct 27: collapsed maggid sections in the זכרו panels */
.zrov .week-h{cursor:pointer;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:0;align-items:center;gap:8px}
.zrov .week-h h3{flex:1}
.zrov .zrov-ch{font-style:normal;color:var(--gold);font-size:22px;line-height:1;transition:transform .2s}
.zrov.on .zrov-ch{transform:rotate(-90deg)}
.zrov.on .week-h{border-color:var(--gold)}
.zrov .list{margin-top:8px}
.zrov-close{margin-top:8px}
