:root{font-synthesis:none;--ink:#17312b;--muted:#65746d;--paper:#f8f6f0;--surface:#fffefa;--green:#12443c;--green2:#196455;--sage:#e8f1e9;--gold:#caa663;--line:#e5e9e1;--shadow:0 12px 35px rgba(27,55,41,.06);color:var(--ink);background:var(--paper);font-family:Arial,"Noto Sans Hebrew","Segoe UI",sans-serif}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;min-height:100dvh;background:var(--paper);line-height:1.5;-webkit-tap-highlight-color:transparent}
a{color:inherit}
button{font:inherit;cursor:pointer}
button:focus-visible,a:focus-visible{outline:3px solid var(--gold);outline-offset:4px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.page-shell{width:min(100%,1080px);margin:0 auto;padding:0 22px 36px}
.topbar{padding:25px 2px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{display:flex;align-items:center;gap:12px}
.brand-icon{height:49px;width:49px;background:var(--green);border-radius:17px;display:flex;align-items:center;justify-content:center;color:#e2bf83;box-shadow:0 7px 16px rgba(15,59,49,.15)}
.brand-icon svg{width:27px;height:27px}
.brand-title,.brand-subtitle{display:block}
.brand-title{font-weight:900;letter-spacing:-.4px;font-size:22px}
.brand-subtitle{font-size:12px;color:var(--muted);margin-top:-2px}
.top-nav{display:flex;align-items:center;gap:4px;background:rgba(228,235,225,.65);border-radius:99px;padding:5px}
.top-nav .tab-button{border:0;background:transparent;color:var(--muted);padding:9px 13px;border-radius:99px;font-weight:800;font-size:12px;white-space:nowrap}
.top-nav .tab-button.is-active{background:var(--green);color:#fff}
.topbar-right{display:flex;align-items:center;gap:10px}
.ny-pill{display:flex;align-items:center;gap:7px;border:1px solid #dce8dd;background:#eff6ef;color:#316454;padding:9px 12px;border-radius:99px;font-size:12px;font-weight:700;white-space:nowrap}
.status-dot{width:7px;height:7px;background:#4fa480;border-radius:50%;box-shadow:0 0 0 4px #d6eadc}
.icon-button{background:var(--surface);border:1px solid var(--line);border-radius:14px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;color:var(--green)}
.icon-button svg{width:18px;height:18px}.icon-button.spinning svg{animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.error-bar{background:#fff3e9;border:1px solid #e9c2a6;padding:12px 16px;border-radius:14px;color:#7c3f21;margin:0 0 18px;font-weight:600;font-size:13px}
.error-bar[hidden]{display:none}
.page-intro{margin:14px 2px 22px}
.eyebrow{color:var(--green2);font-size:12px;font-weight:800;letter-spacing:.15px;margin:0 0 8px}
.page-heading{margin:0;font-size:clamp(25px,4vw,34px);letter-spacing:-.6px;font-weight:900}
.page-intro p{color:var(--muted);margin:6px 0 0;font-size:14px}
.layout{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(290px,.85fr);gap:18px}
.stack{display:grid;gap:18px;align-content:start}
.card{background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);padding:22px;overflow:hidden}
.hero{min-height:290px;padding:26px 28px;background:radial-gradient(circle at 6% 90%,rgba(238,200,138,.18),transparent 34%),linear-gradient(135deg,#174a40 0%,#102e2a 100%);border:0;position:relative;color:#fff;display:flex;flex-direction:column;justify-content:space-between;isolation:isolate}
.hero:before{content:"";position:absolute;inset:0;z-index:-1;opacity:.24;background:radial-gradient(ellipse at 15% 15%,transparent 33%,#5d9683 34%,transparent 35%),radial-gradient(ellipse at 90% 100%,transparent 40%,#5d9683 41%,transparent 42%)}
.hero-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.hero-label{display:flex;align-items:center;gap:8px;font-size:13px;color:#d5e5d8;font-weight:700}
.hero-label svg{height:17px;width:17px;color:#e0bb7f}
.date-pill{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.1);border-radius:100px;padding:6px 12px;font-size:12px;color:#f0e7d7;white-space:nowrap}
.hero-center{padding:28px 0 20px;text-align:center}
.hero-kicker{color:#c4ddcc;font-size:14px;margin:0 0 8px}
.hero-title{font-size:clamp(42px,6vw,64px);line-height:1.18;font-weight:900;margin:0;letter-spacing:-1.2px}
.hero-daf{font-size:clamp(28px,4vw,39px);color:#edca8e;font-weight:700;line-height:1.4}
.hero-bottom{border-top:1px solid rgba(255,255,255,.16);padding-top:14px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.hero-bottom span{color:#d6e6db;font-size:12px}
.hero-link{color:#fff;text-decoration:none;display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:800}
.hero-link svg{height:15px;width:15px}
.stats-title,.section-heading{font-size:18px;margin:0 0 14px;font-weight:900;display:flex;align-items:center;justify-content:space-between;gap:10px}
.stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.stat{padding:18px 10px;border-radius:18px;background:#f4f7f1;text-align:center;min-width:0}
.stat:nth-child(2){background:#faf5e8}
.stat-number{font-size:clamp(26px,4vw,36px);line-height:1.2;letter-spacing:-1px;font-weight:900;direction:ltr;font-variant-numeric:tabular-nums}
.stat-label{font-size:12px;color:var(--muted);font-weight:700;line-height:1.35;margin-top:7px}
.milestone-card{background:var(--surface);position:relative}
.section-label{display:flex;align-items:center;gap:9px;font-weight:800;font-size:13px;color:var(--green2)}
.section-label svg{width:18px;height:18px}
.milestone-number{font-size:clamp(38px,6vw,60px);font-weight:900;line-height:1.2;color:var(--green);letter-spacing:-1.4px;margin:14px 0 4px}
.milestone-number span{font-size:20px;letter-spacing:0;font-weight:700}
.milestone-sub{font-size:18px;font-weight:800;margin:0 0 4px}
.milestone-date{font-size:13px;color:var(--muted);margin:0 0 22px}
.track{width:100%;height:10px;background:#e7ece6;border-radius:99px;overflow:hidden}
.track .fill{display:block;background:linear-gradient(90deg,#b89459,#d8b97e);height:100%;border-radius:inherit;transition:width .6s ease}
.track.green .fill{background:linear-gradient(90deg,#34876e,#18544a)}
.track-meta{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-top:9px}
.siyum-masechta{font-size:27px;font-weight:900;margin:9px 0 3px}
.siyum-time{font-size:14px;color:var(--muted);margin-bottom:17px}
.siyum-footer{display:flex;justify-content:space-between;gap:10px;font-size:13px;color:var(--green2);font-weight:700;margin-top:16px}
.inline-link{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;color:var(--green2);text-decoration:none;font-weight:800;font-size:13px;padding:3px}
.inline-link svg{width:16px;height:16px}
.section-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:4px 2px 14px}
.section-top h2{font-size:19px;margin:0;font-weight:900}
.section-top button{border:0;background:none;color:var(--green2);display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:800}
.section-top button svg{height:15px;width:15px}
.compact-list{display:grid;gap:10px}
.list-row{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--surface);border:1px solid var(--line);padding:15px 17px;border-radius:16px}
.list-row b{font-size:15px}.list-row small{color:var(--muted);font-size:12px;display:block;margin-top:2px}
.round-mark{background:#f7eedc;color:#8b6b35;border-radius:15px;min-width:44px;height:44px;display:flex;align-items:center;justify-content:center}
.round-mark svg{width:21px;height:21px}
.row-main{display:flex;align-items:center;gap:13px;min-width:0}
.row-number{font-size:23px;direction:ltr;color:var(--green);font-weight:900}
.masechta-card{padding:18px 20px}
.masechta-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.masechta-title{font-size:20px;font-weight:900;margin:0}
.masechta-sub{font-size:12px;color:var(--muted);margin:4px 0 0}
.status-chip{padding:5px 9px;border-radius:99px;font-size:11px;font-weight:800;white-space:nowrap}
.status-chip.completed{background:#ebf5ed;color:#22734e}.status-chip.current{background:#f9eed5;color:#977030}.status-chip.upcoming{background:#f3f4f3;color:#78847e}
.masechta-progress{margin-top:14px}
.masechta-progress .track{height:7px}
.masechta-details{margin-top:8px;display:flex;justify-content:space-between;color:var(--muted);font-size:12px;gap:8px}
.pills{display:flex;gap:8px;overflow-x:auto;padding:2px 0 12px;scrollbar-width:none}
.pills::-webkit-scrollbar{display:none}
.pill{flex:0 0 auto;background:var(--surface);border:1px solid var(--line);padding:9px 14px;border-radius:100px;font-size:13px;font-weight:800;color:var(--muted)}
.pill.selected{background:var(--green);border-color:var(--green);color:#fff}
.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.feature-milestone{text-align:center;padding:30px 18px;background:linear-gradient(165deg,#fffcf4,#f6f0e5)}
.feature-medal{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;width:70px;height:70px;color:#8c713a;background:#eadab9}
.feature-medal svg{width:33px;height:33px}
.feature-milestone h2{font-size:42px;line-height:1.1;margin:14px 0 6px}
.feature-milestone p{margin:0;color:var(--muted);font-size:14px}
.feature-milestone .countdown{font-size:24px;font-weight:900;color:var(--green);margin:10px 0}
.milestone-history-item{position:relative;display:flex;gap:15px;padding:9px 0 19px;border-right:2px solid #dce8df;margin-right:13px;padding-right:21px}
.milestone-history-item:last-child{border-right-color:transparent}
.milestone-history-item:before{content:"";position:absolute;right:-8px;top:13px;width:12px;height:12px;background:var(--green2);border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 2px #dce8df}
.history-number{font-weight:900;font-size:19px;color:var(--green)}
.history-date{color:var(--muted);font-size:12px;margin-top:2px}
.day-card{display:flex;justify-content:space-between;align-items:center;gap:10px}
.day-card.today{background:var(--sage);border-color:#bbd3c4}
.day-date{font-weight:900}.day-date small{display:block;font-size:12px;color:var(--muted);font-weight:400}
.day-daf{text-align:left;font-weight:900;font-size:15px}
.day-tag{font-size:11px;color:var(--green2);background:#e5f0e9;border-radius:50px;padding:4px 8px;display:inline-block;margin-top:4px}
.empty-state{color:var(--muted);text-align:center;padding:24px}
.loading{min-height:60vh;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-weight:800;gap:13px;text-align:center}
.loading-mark{height:64px;width:64px;background:var(--sage);color:var(--green);border-radius:19px;display:flex;align-items:center;justify-content:center;animation:pulse 1.8s infinite}
.loading-mark svg{width:34px;height:34px}.loading-line{height:4px;width:140px;border-radius:9px;background:linear-gradient(90deg,#f3f6f0,#1b6a55,#f3f6f0);background-size:200% 100%;animation:load 1.5s linear infinite}
@keyframes pulse{50%{transform:scale(1.06)}}@keyframes load{to{background-position:-200%}}
.page-footer{margin-top:40px;display:flex;gap:10px;justify-content:space-between;color:#96a198;font-size:11px;padding:0 3px}.page-footer a{color:#718b7d}
.bottom-nav{display:none}
@media(max-width:760px){
 .top-nav{display:none}
 .page-shell{padding:0 15px 100px}
 .topbar{padding:19px 2px 18px}
 .brand-icon{height:43px;width:43px;border-radius:14px}
 .brand-title{font-size:19px}.brand-subtitle{font-size:10px}
 .ny-pill{font-size:0;padding:8px;min-width:24px;min-height:30px;justify-content:center}
 .ny-pill:after{content:"ניו יארק";font-size:10px}
 .topbar-right{gap:7px}.icon-button{width:34px;height:34px;border-radius:11px}
 .page-intro{margin:8px 1px 16px}.page-heading{font-size:25px}.page-intro p{font-size:13px}
 .layout,.two-cols{grid-template-columns:1fr;gap:14px}.stack{gap:14px}
 .card{border-radius:19px;padding:18px}
 .hero{min-height:290px;padding:20px 20px 18px}
 .hero-title{font-size:clamp(32px,8.5vw,48px)}.hero-daf{font-size:32px}.date-pill{font-size:11px;padding:6px 9px}
 .stats-grid{gap:8px}.stat{padding:17px 6px;border-radius:14px}.stat-number{font-size:29px}.stat-label{font-size:11px}
 .milestone-number{font-size:50px}.siyum-masechta{font-size:25px}
 .page-footer{flex-direction:column;align-items:center;margin-top:25px;gap:3px}
 .bottom-nav{display:flex;justify-content:space-around;position:fixed;bottom:0;bottom:env(safe-area-inset-bottom,0);right:0;left:0;padding:8px 12px 7px;background:rgba(255,254,250,.97);border-top:1px solid var(--line);box-shadow:0 -8px 24px rgba(15,40,30,.05);backdrop-filter:blur(14px);z-index:10}
 .bottom-nav:after{content:"";position:fixed;bottom:calc(-1 * env(safe-area-inset-bottom,0));height:env(safe-area-inset-bottom,0);left:0;right:0;background:rgba(255,254,250,.97)}
 .tab-button{border:0;min-width:64px;flex:1;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;padding:4px 0;color:#81948b;background:transparent;font-size:10px;font-weight:800}
 .tab-button svg{width:21px;height:21px;stroke-width:1.9}
 .tab-button.is-active{color:var(--green2)}
 .tab-button.is-active svg{background:#e4f0e7;border-radius:9px;box-sizing:content-box;padding:6px;margin:-6px -6px 0}
}
@media(max-width:370px){.page-shell{padding-inline:11px}.brand-title{font-size:17px}.brand-subtitle{font-size:9px}.hero-title{font-size:42px}.hero-daf{font-size:29px}.stat-number{font-size:25px}.date-pill{font-size:10px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation:none!important;transition:none!important}}

/* Center numeric milestones together with their labels on small RTL screens. */
.milestone-card{text-align:center}
.milestone-card .section-label{justify-content:flex-start;text-align:start}
.milestone-number{display:flex;direction:ltr;justify-content:center;align-items:baseline;gap:10px;margin:16px 0 7px;white-space:nowrap;letter-spacing:-1px}
.milestone-number bdi{font-variant-numeric:tabular-nums;line-height:1}
.milestone-number span{direction:rtl;unicode-bidi:isolate;line-height:1.3}
.milestone-sub,.milestone-date{text-align:center}
.milestone-sub{margin:3px 0 6px}
.milestone-date{margin:0 0 16px;line-height:1.7}
.milestone-card .track{margin-top:15px}
.track-meta{direction:rtl;gap:10px;align-items:baseline}
.track-meta span{min-width:0}
.track-meta span:first-child{text-align:start}
.track-meta span:last-child{text-align:end}
.siyum-heading{margin:13px 0 15px}
.siyum-heading .siyum-masechta{margin:0 0 4px}
.siyum-heading .siyum-time{margin:0}
.siyum-card .siyum-footer{gap:12px;align-items:center}
.siyum-card .siyum-footer span{min-width:0}
.siyum-card .siyum-footer span:last-child{text-align:end}
/* Swipe through the previous 7 Daf Yomi days; keep today's date first. */
.day-browse{margin-bottom:14px}
.day-browse .section-heading{margin-bottom:10px}
.day-strip{display:flex;flex-wrap:nowrap;gap:9px;overflow-x:auto;scroll-snap-type:x proximity;overscroll-behavior-inline:contain;scrollbar-width:thin;padding:3px 3px 12px}
.day-pick{flex:0 0 122px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:12px 10px;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);scroll-snap-align:start;font-weight:800;font-size:13px}
.day-pick small{font-size:11px;font-weight:600;color:var(--muted);white-space:nowrap}
.day-pick.active{background:var(--green);border-color:var(--green);color:#fff}
.day-pick.active small{color:#e1eee4}
.selected-day{text-align:center;margin-bottom:18px;padding:22px}
.selected-day .section-label{justify-content:center}
.chosen-date{margin:10px 0 6px;color:var(--muted);font-size:13px}
.chosen-masechta{font-size:clamp(26px,5vw,36px);font-weight:900;line-height:1.25;margin:0}
.chosen-daf{font-size:28px;font-weight:900;color:var(--green2);margin:6px 0}
.chosen-link{display:inline-flex;align-items:center;justify-content:center;gap:7px;color:var(--green2);font-size:13px;font-weight:800;text-decoration:none;margin-top:7px}
.chosen-link svg{width:15px;height:15px}
@media(max-width:760px){
 .milestone-number{font-size:clamp(36px,10vw,50px);gap:9px}
 .milestone-number span{font-size:clamp(17px,5vw,22px)}
 .milestone-card{padding:20px 18px}
 .siyum-heading{margin:10px 0 12px}
 .siyum-footer{font-size:12px}
 .day-pick{flex-basis:108px}
 .selected-day{margin-bottom:14px}
}
@media(max-width:370px){
 .milestone-number{font-size:39px}
 .milestone-number span{font-size:18px}
 .track-meta{font-size:11px}
}

/* Milestones: show meaningful goals and events rather than 25-blatt increments. */
.achievement-main-title{font-size:clamp(28px,5vw,42px);line-height:1.22;font-weight:900;margin:16px 0 8px;text-wrap:balance;overflow-wrap:anywhere}
.achievement-feature-title{font-size:clamp(26px,5vw,40px)!important;line-height:1.25!important;text-wrap:balance}
.achievement-days{font-size:13px!important;white-space:nowrap}
.feature-progress{margin-top:20px}
.feature-milestone .countdown{margin:10px 0}
.milestone-card .track{margin-top:13px}
.theme-toggle{flex:0 0 40px}
.theme-toggle svg{width:18px;height:18px}
/* Dark palette for cards, app navigation, charts, and all four tabs. */
:root[data-theme="dark"]{
  color-scheme:dark;
  --ink:#e6f2ec;--muted:#acbeb5;--paper:#0b1715;--surface:#142622;
  --green:#246d5b;--green2:#88d4b8;--sage:#203a32;--gold:#e2bb7e;
  --line:#304840;--shadow:0 12px 35px rgba(0,0,0,.24);
}
:root[data-theme="dark"] body{background:var(--paper)}
:root[data-theme="dark"] .hero{background:radial-gradient(circle at 6% 90%,rgba(238,200,138,.13),transparent 34%),linear-gradient(135deg,#194b3d,#0e2a25)}
:root[data-theme="dark"] .stat{background:#233a34}
:root[data-theme="dark"] .stat:nth-child(2){background:#413626}
:root[data-theme="dark"] .brand-icon{background:#22584a}
:root[data-theme="dark"] .top-nav{background:#192f29}
:root[data-theme="dark"] .top-nav .tab-button.is-active{background:#357762}
:root[data-theme="dark"] .ny-pill{background:#1c352c;border-color:#355847;color:#c1e8d1}
:root[data-theme="dark"] .status-dot{box-shadow:0 0 0 4px #294b3d}
:root[data-theme="dark"] .icon-button{color:#d6f1e4}
:root[data-theme="dark"] .round-mark{background:#453c2b;color:#e4bf80}
:root[data-theme="dark"] .feature-milestone{background:linear-gradient(160deg,#2b3027,#1b2924)}
:root[data-theme="dark"] .feature-medal{background:#4b3c28;color:#e4be7c}
:root[data-theme="dark"] .milestone-number,:root[data-theme="dark"] .history-number{color:#9bd9c1}
:root[data-theme="dark"] .track{background:#32443d}
:root[data-theme="dark"] .track .fill{background:linear-gradient(90deg,#ac864d,#f0c682)}
:root[data-theme="dark"] .track.green .fill{background:linear-gradient(90deg,#36a585,#89d9bc)}
:root[data-theme="dark"] .status-chip.completed{background:#284c3a;color:#b3eac8}
:root[data-theme="dark"] .status-chip.current{background:#443a29;color:#edc889}
:root[data-theme="dark"] .status-chip.upcoming{background:#2e3c35;color:#bbc9c0}
:root[data-theme="dark"] .day-card.selected,:root[data-theme="dark"] .day-card.today{background:#254738;border-color:#41795d}
:root[data-theme="dark"] .day-tag{background:#32614b;color:#e5f6e9}
:root[data-theme="dark"] .day-pick.active{background:#387e69;color:white}
:root[data-theme="dark"] .day-pick.active small{color:#ebfff6}
:root[data-theme="dark"] .pill.selected{background:#3a826b;color:#fff;border-color:#3a826b}
:root[data-theme="dark"] .bottom-nav{background:rgba(17,35,29,.98);border-color:#355043;box-shadow:0 -8px 24px rgba(0,0,0,.3)}
:root[data-theme="dark"] .bottom-nav:after{background:rgba(17,35,29,.98)}
:root[data-theme="dark"] .tab-button{color:#a6bdb1}
:root[data-theme="dark"] .tab-button.is-active{color:#9be5bf}
:root[data-theme="dark"] .tab-button.is-active svg{background:#294f3f}
:root[data-theme="dark"] .loading-mark{background:#274839;color:#c0eaca}
:root[data-theme="dark"] .error-bar{background:#3a241f;border-color:#7b4734;color:#ffd3bc}
:root[data-theme="dark"] .page-footer{color:#9daea4}
:root[data-theme="dark"] .page-footer a{color:#b2dac7}
:root[data-theme="dark"] .milestone-history-item{border-color:#345447}
:root[data-theme="dark"] .milestone-history-item:before{box-shadow:0 0 0 2px #456e59;border-color:#173128}
@media(max-width:760px){.theme-toggle{flex-basis:34px}}

/* Readable dark-mode achievement cards: do not mix a white background with light text. */
:root[data-theme="dark"] .milestone-card{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .achievement-main-title,
:root[data-theme="dark"] .achievement-feature-title{color:var(--ink)}
:root[data-theme="dark"] .milestone-sub{color:#e6f2ec}
:root[data-theme="dark"] .feature-milestone .countdown,
:root[data-theme="dark"] .row-number,
:root[data-theme="dark"] .achievement-days{color:#a4e8cc}
:root[data-theme="dark"] .milestone-date,
:root[data-theme="dark"] .track-meta,
:root[data-theme="dark"] .feature-milestone p{color:var(--muted)}
