/* תהלים ביחד — קרם וזהב (ברירת מחדל), ולילה כחול-דיו ב-data-theme=dark */
@font-face { font-family: 'BeitYosef'; src: url(fonts/beit-yosef.woff2) format('woff2'); font-display: block; }
@font-face { font-family: 'TaameyFrank'; src: url(fonts/taamey-frank.woff2) format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'TaameyFrank'; src: url(fonts/taamey-frank-bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* בהיר — קרם */
  --bg: #f6efe0;
  --fg: #2a2116;
  --accent: #8a6424;
  --gold: #d9b46a;
  --gold2: #b8893f;
  --muted: rgba(42, 33, 22, .74);
  --faint: rgba(42, 33, 22, .64);
  --line: rgba(140, 106, 51, .24);
  --surface: rgba(255, 252, 244, .72);
  --surface-2: #fffaf0;
  --input: #fffdf8;
  --input-line: rgba(42, 33, 22, .16);
  --seg-free: rgba(42, 33, 22, .10);
  --seg-held: rgba(184, 137, 63, .45);
  --mine: #6b4a14;
  --shadow: 0 30px 80px -34px rgba(90, 64, 24, .35);
  --overlay: rgba(42, 33, 22, .38);
  --menu: rgba(255, 250, 240, .97);
  --glow: none;
  --sky1: rgba(217, 180, 106, .28);
  --sky2: rgba(255, 255, 255, .7);
  --sky-base: linear-gradient(180deg, #fbf6ea, var(--bg) 60%);
  /* הקלף */
  --parch: #fbf5e6;
  --text: #22190f;
  --p-head: #7a5a26;
  --p-num: #806030;
  --p-bar: rgba(251, 245, 230, .9);
  --p-line: rgba(90, 64, 24, .14);
  --p-chip: #5b4320;
  --ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --display: 'Cormorant Garamond', 'TaameyFrank', Georgia, serif;
  --fs: 26px;
  --r: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0a1120;
  --fg: #f3ead6;
  --accent: #e6c681;
  --gold: #e6c681;
  --gold2: #c49a52;
  --muted: rgba(243, 234, 214, .66);
  --faint: rgba(243, 234, 214, .58);
  --line: rgba(230, 198, 129, .18);
  --surface: rgba(255, 255, 255, .045);
  --surface-2: #131c30;
  --input: rgba(10, 17, 32, .55);
  --input-line: rgba(243, 234, 214, .14);
  --seg-free: rgba(243, 234, 214, .09);
  --seg-held: rgba(230, 198, 129, .42);
  --mine: #fff6dc;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .6);
  --overlay: rgba(4, 8, 16, .62);
  --menu: rgba(17, 26, 45, .97);
  --glow: url(#glow);
  --sky1: rgba(230, 198, 129, .16);
  --sky2: rgba(60, 90, 150, .22);
  --sky-base: linear-gradient(180deg, #0c1427, var(--bg) 55%);
  --parch: #16130e;
  --text: #ece2cb;
  --p-head: #d2ad66;
  --p-num: #c4a165;
  --p-bar: rgba(22, 19, 14, .92);
  --p-line: rgba(230, 198, 129, .14);
  --p-chip: #e3cf9f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--fg);
  font: 400 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}
html[lang="he"] { --display: 'TaameyFrank', 'Cormorant Garamond', serif; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* רקע: הילה זהובה מלמעלה + גרעין דק */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, var(--sky1), transparent 60%),
    radial-gradient(80% 60% at 100% 110%, var(--sky2), transparent 60%),
    var(--sky-base);
}
.sky::after {
  content: ''; position: absolute; inset: 0; opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* כותרת עליונה */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 6px;
  max-width: 760px; width: 100%; margin: 0 auto;
}
.logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); text-decoration: none; color: var(--accent); transition: border-color .3s; }
@media (hover: hover) { .logo:hover { border-color: var(--gold2); } }
.logo-mark { width: 26px; height: 26px; object-fit: contain; }
.tools { display: flex; align-items: center; gap: 8px; }
.lang { position: relative; }
.tool-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.tool-btn svg { width: 20px; height: 20px; }
.tools .a11y-btn { border-color: var(--line); background: var(--surface); color: var(--muted); opacity: 1; }
.tools .a11y-btn svg { width: 22px; height: 22px; }
html[data-theme="dark"] .i-moon, html:not([data-theme="dark"]) .i-sun { display: none; }
.lang-btn { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.lang-btn svg { width: 18px; height: 18px; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: 52px; z-index: 30; list-style: none; margin: 0; padding: 6px; min-width: 160px;
  background: var(--menu); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); animation: pop .22s var(--ease);
}
.lang-menu button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 0; background: none; border-radius: 10px; font-size: 15px; text-align: start; }
.lang-menu button:hover, .lang-menu button[aria-current="true"] { background: rgba(184, 137, 63, .12); color: var(--accent); }
.lang-menu small { color: var(--faint); }

main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 20px 24px; }
.view { animation: rise .6s var(--ease); }

/* הטבעת */
.ring-wrap { position: relative; width: min(84vw, 340px); aspect-ratio: 1; margin: 6px auto 0; }
.ring { width: 100%; height: 100%; overflow: visible; }
.ring .seg { stroke: none; transition: fill .6s var(--ease), opacity .6s; }
.ring .s0 { fill: var(--seg-free); }
.ring .s1 { fill: var(--seg-held); animation: breathe 2.4s ease-in-out infinite; }
.ring .s2 { fill: url(#gold); filter: var(--glow); }
.ring .mine { fill: var(--mine); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.mark { font: clamp(64px, 19vw, 92px)/1 'BeitYosef'; color: var(--accent); text-shadow: 0 0 40px rgba(230, 198, 129, .3); letter-spacing: .02em; }
.mark.small { font-size: 56px; }
.mark-sub { margin-top: 10px; font: 500 15px/1 var(--ui); letter-spacing: .42em; text-transform: uppercase; color: var(--muted); padding-inline-start: .42em; }
html[lang="he"] .mark-sub { letter-spacing: .3em; font-size: 17px; }
.tagline { text-align: center; color: var(--muted); font: 400 clamp(19px, 5vw, 23px)/1.4 var(--display); margin: 8px auto 26px; max-width: 24ch; text-wrap: balance; }

/* כרטיס */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06); }
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; color: var(--faint); margin-bottom: 8px; letter-spacing: .03em; }
.field input {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 14px; font-size: 17px;
  background: var(--input); border: 1px solid var(--input-line); outline: none; transition: border-color .25s, box-shadow .25s;
}
.field input::placeholder { color: var(--faint); opacity: .75; }
.field input:focus { border-color: var(--gold2); box-shadow: 0 0 0 4px rgba(230, 198, 129, .12); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 66px; padding: 8px 6px; border-radius: 14px; border: 1px solid var(--input-line); background: var(--input); text-align: center; cursor: pointer; transition: all .25s var(--ease); }
.seg b { font-weight: 500; font-size: 14px; line-height: 1.2; }
.seg i { font-style: normal; font-size: 12px; color: var(--faint); }
.seg input:checked + span { border-color: var(--gold2); background: rgba(217, 180, 106, .16); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(230, 198, 129, .25); }
.seg input:checked + span i { color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* כפתורים */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; font-weight: 500; font-size: 16px; text-decoration: none; transition: transform .2s var(--ease), box-shadow .3s, background .3s, opacity .3s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.big { width: 100%; min-height: 60px; font-size: 18px; }
.btn.gold {
  color: #1b1408; background: linear-gradient(180deg, #f1d797, var(--gold) 45%, var(--gold2));
  box-shadow: 0 12px 30px -10px rgba(230, 198, 129, .55), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(0, 0, 0, .12);
}
@media (hover: hover) { .btn.gold:hover { box-shadow: 0 16px 40px -10px rgba(230, 198, 129, .75), inset 0 1px 0 rgba(255, 255, 255, .55); } }
.btn.ghost { color: var(--fg); background: var(--surface); border: 1px solid var(--line); }
@media (hover: hover) { .btn.ghost:hover { border-color: var(--gold2); color: var(--accent); } }
.btn.ink { color: #fbf5e6; background: linear-gradient(180deg, #2c2418, #18120a); box-shadow: 0 14px 30px -12px rgba(40, 26, 8, .7), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.wa { color: #fff; background: #15803d; }
.btn.wa .fillp { fill: #fff; stroke: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.busy { pointer-events: none; opacity: .75; }
.icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: inherit; }
.icon svg { width: 22px; height: 22px; }
.icon.small { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font: 600 15px/1 var(--ui); }
.icon.small sup { font-size: 10px; }

.steps { list-style: none; display: flex; justify-content: center; gap: 10px; padding: 0; margin: 26px 0 8px; }
.steps li { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 14px; }
.steps li + li::before { content: ''; width: 18px; height: 1px; background: var(--line); margin-inline-end: 4px; }
.steps svg { width: 18px; height: 18px; color: var(--gold2); }

.mine { margin-top: 26px; }
.mine h3 { font: 500 13px/1 var(--ui); color: var(--faint); letter-spacing: .06em; margin: 0 4px 10px; }
.mine ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mine a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--fg); transition: border-color .25s; }
@media (hover: hover) { .mine a:hover { border-color: var(--gold2); } }
.mine a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine a small { color: var(--accent); flex: none; font-variant-numeric: tabular-nums; }

/* דף הקריאה */
.r-title { text-align: center; font: 600 clamp(26px, 7.4vw, 38px)/1.2 var(--display); margin: 10px auto 2px; max-width: 18ch; color: var(--fg); text-wrap: balance; overflow-wrap: anywhere; }
.count { font: 600 clamp(54px, 16vw, 76px)/1 'Cormorant Garamond', serif; color: var(--accent); font-variant-numeric: lining-nums tabular-nums; display: flex; align-items: baseline; gap: 2px; direction: ltr; }
.count span { font-size: .36em; color: var(--faint); font-weight: 500; }
.round { margin-top: 10px; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.legend { list-style: none; display: flex; justify-content: center; gap: 18px; padding: 0; margin: 4px 0 22px; font-size: 13px; color: var(--faint); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend li::before { content: ''; width: 9px; height: 9px; border-radius: 3px; }
.lg-done::before { background: var(--gold2); }
.lg-held::before { background: var(--seg-held); }
.lg-free::before { background: var(--seg-free); box-shadow: inset 0 0 0 1px var(--line); }
.actions { display: grid; gap: 12px; }
.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .row .btn { padding: 0 12px; font-size: 15px; }
.meta { text-align: center; color: var(--faint); font-size: 13px; margin: 6px 0 0; }
.empty { text-align: center; padding: 18vh 0; display: grid; gap: 18px; justify-items: center; color: var(--muted); }

/* הקורא — קלף */
.reader { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--parch); color: var(--text); animation: slideUp .5s var(--ease); }
.reader::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .55), transparent 60%), radial-gradient(140% 100% at 50% 120%, rgba(164, 120, 52, .18), transparent 60%); }
html[data-theme="dark"] .reader::before { background: radial-gradient(120% 80% at 50% 0%, rgba(230, 198, 129, .07), transparent 60%); }
.rd-bar { position: relative; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; border-bottom: 1px solid var(--p-line); background: var(--p-bar); backdrop-filter: blur(10px); }
.rd-label { font-variant-numeric: lining-nums; flex: 1; min-width: 0; font: 600 18px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--p-head); }
.rd-tools { display: flex; align-items: center; gap: 2px; }
.chip { height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--p-line); background: transparent; font-size: 13px; color: var(--p-chip); white-space: nowrap; }
.chip:hover { border-color: #8c6a33; }
.rd-scroll { position: relative; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.parchment { max-width: 980px; margin: 0 auto; padding: 22px 18px 150px; font-family: 'TaameyFrank', 'Times New Roman', serif; font-size: var(--fs); line-height: 2.05; }
.parchment.stam { font-family: 'BeitYosef'; line-height: 1.75; font-size: calc(var(--fs) * 1.1); }

.ps { margin-bottom: 1.4em; }
.ps-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin: .4em 0 .7em; color: var(--p-head); }
.ps-head::before, .ps-head::after { content: ''; flex: 1; max-width: 90px; height: 1px; background: linear-gradient(90deg, transparent, rgba(140, 106, 51, .55)); }
.ps-head::after { transform: scaleX(-1); }
.ps-num { font: 42px/1 'BeitYosef'; color: var(--p-head); }
.ps-alt { font: 500 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--p-num); direction: ltr; }
.book { text-align: center; font: 600 15px/1 var(--ui); letter-spacing: .3em; color: var(--p-head); margin: .2em 0 1em; }

/* שורות הכתר: שתי צלעות זו מול זו */
.ln { display: flex; justify-content: space-between; gap: 1.6em; margin: 0; }
.ln.full { display: block; text-align: center; }
.ln .h { flex: 1 1 0; }
.ln .h:first-child { text-align: start; }
.ln .h:last-child { text-align: end; }
.ln.solo .h { text-align: start; }
.vn { font: 500 .42em/1 var(--ui); color: var(--p-num); vertical-align: .9em; margin-inline-end: .25em; font-variant-numeric: lining-nums; }
.parchment.stam .vn { font-size: .36em; }
.cut { display: block; height: .35em; }

/* בטלפון: כל צלע בשורה משלה, השנייה מוזחת — אותה חלוקה, בלי לכווץ את האות */
@media (max-width: 1040px) {
  .parchment { padding-inline: 16px; line-height: 1.9; }
  .ln, .ln.full { display: block; text-align: start; text-align-last: auto; }
  .ln .h { display: block; text-align: start !important; padding-inline-start: 2.4em; text-indent: -2.4em; }
  .ln .h + .h { padding-inline-start: 3.8em; }
}

.rd-foot { position: absolute; inset-inline: 0; bottom: 0; padding: 16px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--parch) 40%); display: grid; justify-items: center; gap: 6px; }
.rd-foot .btn { max-width: 420px; }
.rd-foot small { color: var(--p-num); font-size: 12px; }
.rd-loading { text-align: center; padding: 30vh 0; color: var(--p-num); font: 16px var(--ui); }

/* גיליון */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); animation: fade .3s; }
.sheet-card { position: relative; width: 100%; max-width: 620px; max-height: 82vh; display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation: slideUp .4s var(--ease); box-shadow: 0 -30px 80px rgba(0, 0, 0, .25); }
.sheet-card.narrow { max-width: 460px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 10px; font-size: 17px; }
.grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 7px; padding: 4px 2px 6px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tile { min-height: 50px; padding: 4px; border-radius: 12px; border: 1px solid var(--input-line); background: var(--input); font: 500 15px/1.15 var(--ui); color: var(--fg); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all .2s; }
.tile.heb { font: 22px/1 'BeitYosef'; }
.tile small { font: 400 11px/1.2 var(--ui); color: var(--faint); margin-top: 3px; }
@media (hover: hover) { .tile:hover { border-color: var(--gold2); color: var(--accent); } }
.tile.t1 { background: var(--seg-held); color: var(--accent); opacity: .7; border-color: transparent; pointer-events: none; }
.tile.t2 { background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #22180a; border-color: transparent; pointer-events: none; }
.tile.t2 small { color: rgba(34, 24, 10, .6); }
.share-url { padding: 14px 16px; border-radius: 14px; background: var(--input); border: 1px solid var(--line); font-size: 14px; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 14px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* תודה */
.celebrate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: var(--overlay); backdrop-filter: blur(8px); animation: fade .35s; }
#sparks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cel-card { position: relative; text-align: center; max-width: 380px; width: 100%; padding: 30px 22px 22px; border-radius: 28px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .5s var(--ease); }
.cel-check { width: 76px; height: 76px; color: var(--gold2); stroke-width: 2.4; }
.cel-check circle { stroke-dasharray: 176; stroke-dashoffset: 176; animation: draw .8s .1s var(--ease) forwards; opacity: .55; }
.cel-check path { stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s .55s var(--ease) forwards; }
.cel-card h2 { font: 600 28px/1.2 var(--display); margin: 12px 0 6px; color: var(--fg); text-wrap: balance; }
.cel-card p { color: var(--muted); margin: 0 0 22px; }
.cel-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 13px 20px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 15px; font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); transition: all .35s var(--ease); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.foot { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--faint); letter-spacing: .03em; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
.foot-links a { color: var(--muted); text-decoration: none; padding: 8px 6px; font-size: 13px; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.maker { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 14px; text-decoration: none; color: var(--faint); font-size: 11px; transition: background .25s; }
.maker:hover { background: var(--surface); }
.maker img { height: 34px; width: auto; display: block; }
.maker .lg-dark, html[data-theme="dark"] .maker .lg-light { display: none; }
html[data-theme="dark"] .maker .lg-dark { display: block; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--fg); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.reader :focus-visible { outline-color: var(--p-head); }
html[data-theme="dark"] .btn.ink { color: #1b1408; background: linear-gradient(180deg, #f1d797, var(--gold) 45%, var(--gold2)); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.loading .ring .seg { animation: breathe 1.6s ease-in-out infinite; }
.loading .legend, .loading .actions { visibility: hidden; }
.r-title.long { font-size: clamp(20px, 5.4vw, 28px); max-width: 24ch; }
.reader:not([hidden]) ~ .toast { bottom: calc(112px + env(safe-area-inset-bottom)); }
/* במחשב: גיליונות כרטיס במרכז, וסרגל הקורא בקו עם הקלף */
@media (min-width: 721px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 26px; border-bottom: 1px solid var(--line); animation: pop .35s var(--ease); max-height: 78vh; }
  .rd-bar { padding-inline: max(10px, calc((100% - 980px) / 2)); }
}

/* מונה כללי (מוצג מ-100 ספרים שלמים) */
.counter { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: -10px auto 24px; max-width: 30ch; text-align: center; color: var(--muted); font-size: 14px; }
.counter .c-num { font: 600 24px/1 'Cormorant Garamond', serif; color: var(--accent); font-variant-numeric: lining-nums; }
.counter .c-row { display: inline-flex; align-items: baseline; gap: 8px; }
