@font-face { font-family: Heebo; src: url(../fonts/heebo-hebrew.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: Frank; src: url(../fonts/frank-hebrew.woff2) format('woff2'); font-weight: 300 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }

:root {
  --bg: #f1f4f8; --card: #fff; --ink: #1c2430; --muted: #5c6777; --line: #e0e5ed;
  --navy: #16304f; --navy2: #24507f; --accent: #2d6bb4; --soft: #dbe7f6; --green: #23805a; --green-bg: #e4f3ea;
  --r: 18px; --shadow: 0 1px 2px rgba(22, 48, 79, .06), 0 6px 18px rgba(22, 48, 79, .07);
  --sans: Heebo, system-ui, "Segoe UI", Arial, sans-serif; --serif: Frank, "Frank Ruehl CLM", "David", "Times New Roman", serif;
  --font: 21px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --bg: #0f141b; --card: #182029; --ink: #ebe6dc; --muted: #a3acb7; --line: #2a3440; --navy: #a9c8ee; --navy2: #6f9fd6; --accent: #5b9be0; --soft: #1d3550; --green: #4fbf8c; --green-bg: #17302a; --shadow: none; } }
:root[data-theme=dark] { --bg: #0f141b; --card: #182029; --ink: #ebe6dc; --muted: #a3acb7; --line: #2a3440; --navy: #a9c8ee; --navy2: #6f9fd6; --accent: #5b9be0; --soft: #1d3550; --green: #4fbf8c; --green-bg: #17302a; --shadow: none; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body.reading { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
main { max-width: 640px; margin: 0 auto; padding: 0 14px; outline: none; }
.muted { color: var(--muted); font-size: 14px; }
h2.sec { font-size: 15px; font-weight: 800; color: var(--navy2); margin: 20px 4px 8px; }

/* header */
.hero { margin: 0 -14px 16px; padding: calc(14px + env(safe-area-inset-top)) 16px 18px; color: #fff; border-radius: 0 0 28px 28px;
  background: radial-gradient(85% 75% at 92% 0%, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 62%), linear-gradient(165deg, #3a7fcb 0%, #2560a6 50%, #1c4b87 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .hero { background: linear-gradient(165deg, #2a609e, #1c4577 50%, #15365c); } }
:root[data-theme=dark] .hero { background: linear-gradient(165deg, #2a609e, #1c4577 50%, #15365c); }
@media (min-width: 668px) { .hero { margin: 12px 0 16px; border-radius: 28px; } }
.hero h1 { font-size: 26px; margin: 0; font-weight: 800; }
.hero small { opacity: .85; font-size: 14px; }
.daybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daybar .date { text-align: center; display: flex; flex-direction: column; align-items: center; }
.daybar .date button { all: unset; cursor: pointer; font-size: 13px; opacity: .85; text-decoration: underline; margin-top: 2px; }
.nav-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); font-size: 26px; line-height: 1; color: #fff; }
.summary { display: flex; align-items: center; gap: 14px; margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .2); padding: 14px 2px 0; }
.summary b { display: block; font-size: 17px; }
.ring { --p: 0; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(255, 255, 255, .22) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); }
.ring span { position: relative; font-weight: 800; font-size: 14px; }
.page-hero { padding-bottom: 20px; }

/* cards */
.card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.card .t { flex: 1; min-width: 0; }
.card .rl { display: block; font-size: 17px; font-weight: 800; color: var(--navy); }
.card .sub { display: block; color: var(--muted); font-size: 14px; }
.card .go { flex: none; color: var(--accent); font-size: 22px; }
.card.done { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.card.done .go { color: var(--green); }
.card.big .rl { font-size: 22px; font-family: var(--serif); }
.tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: var(--card); }
.tick svg { width: 18px; height: 18px; fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done .tick { background: var(--green); border-color: var(--green); }
.done .tick svg { stroke: #fff; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 18px; }

/* books */
.book { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; margin-bottom: 6px; }
.book b { font-size: 16px; font-weight: 700; }
.book small { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.book.full .bar i { background: var(--green); }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.chgrid a { display: grid; place-items: center; height: 48px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 17px; }
.chgrid a.done { background: var(--green); border-color: var(--green); color: #fff; }
.chgrid a.today { border: 2px solid var(--accent); }
.back { all: unset; cursor: pointer; color: #fff; opacity: .9; font-size: 14px; }

/* settings */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row > span { font-weight: 600; }
.row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.seg { display: flex; background: var(--bg); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--card); box-shadow: var(--shadow); font-weight: 700; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { background: var(--soft); color: var(--navy); }
.about p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }

/* tab bar */
.tabbar { position: fixed; bottom: 0; inset-inline: 0; display: flex; justify-content: center; gap: 4px; background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.tabbar a { flex: 0 1 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a[aria-current=page] { color: var(--accent); background: var(--soft); }

/* reader */
.reader { position: fixed; inset: 0; background: var(--card); z-index: 10; display: flex; flex-direction: column; }
.reader[hidden] { display: none; }
.rhead { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; border-bottom: 1px solid var(--line); }
.rhead h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; color: var(--navy); text-align: center; }
.icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rbody { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ropts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 16px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); max-width: 760px; margin: 0 auto; }
.ropts label { display: inline-flex; align-items: center; gap: 5px; }
.ropts input { accent-color: var(--accent); width: 17px; height: 17px; }
.text { max-width: 760px; margin: 0 auto; padding: 14px 18px 30px; font: var(--font)/1.85 var(--serif); }
.verse > p { margin: 0 0 .25em; }
.vn { font-family: var(--sans); font-size: .6em; font-weight: 800; color: var(--accent); margin-inline-end: .3em; vertical-align: .25em; }
.pm { font-family: var(--sans); font-size: .6em; color: var(--muted); margin: 0 .3em; }
.cms { margin: 0 0 .6em; }
details.cm { font-size: .78em; line-height: 1.65; }
details.cm:not([open]) { display: inline-block; margin-inline-end: .35em; }
details.cm > summary { list-style: none; display: inline-flex; align-items: center; gap: .35em; cursor: pointer; font-family: var(--sans); font-size: .8em; font-weight: 700; color: #fff; background: var(--navy2); border-radius: 999px; padding: .2em .85em; }
details.cm.md > summary { background: #2d7d74; }
details.cm.mz > summary { background: #6b5bb5; }
details.cm > summary::-webkit-details-marker { display: none; }
details.cm > summary::after { content: "+"; font-weight: 800; }
details.cm[open] > summary::after { content: "−"; }
details.cm[open] { display: block; background: var(--bg); border-radius: 12px; padding: .45em .8em; margin: .25em 0 .45em; }
details.cm[open] > summary { margin-bottom: .35em; }
details.cm p { margin: 0 0 .35em; }
.rfoot { max-width: 760px; margin: 0 auto; padding: 4px 18px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.finish { width: 100%; border: 2px solid var(--green); background: var(--card); color: var(--green); border-radius: 999px; padding: 13px; font-weight: 800; font-size: 17px; }
.finish[aria-pressed=true] { background: var(--green); color: #fff; }
.pn { display: flex; gap: 10px; }
.pn a { flex: 1; text-align: center; padding: 11px; border-radius: 999px; background: var(--soft); color: var(--navy); font-weight: 700; font-size: 15px; }
.pn a[aria-disabled=true] { visibility: hidden; }
.err { color: var(--muted); text-align: center; font-family: var(--sans); font-size: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
