:root {
  --navy: #0b2147;
  --deep: #12336b;
  --royal: #1f5fbf;
  --sky: #4a8ae8;
  --mist: #a9c8f5;
  --ice: #e4eefc;
  --bg: #f3f7fd;
  --card: #ffffff;
  --ink: #0f1d36;
  --muted: #5a6a86;
  --line: #dbe6f6;
  --cue-bg: #e8f1ff;
  --cue-ink: #1d4f9e;
  --gold: #c9a24a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(11, 33, 71, 0.06), 0 6px 20px rgba(11, 33, 71, 0.06);
  --he: "Frank Ruhl Libre", "Times New Roman", "Arial Hebrew", serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --he-size: 1.6rem;
  --tr-size: 1.05rem;
  --en-size: 0.98rem;
  color-scheme: light dark;
}
html[data-size="s"] { --he-size: 1.35rem; --tr-size: 0.95rem; --en-size: 0.9rem; }
html[data-size="l"] { --he-size: 1.95rem; --tr-size: 1.2rem; --en-size: 1.1rem; }
html[data-size="xl"] { --he-size: 2.35rem; --tr-size: 1.35rem; --en-size: 1.22rem; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07132a;
    --card: #0e1f3f;
    --ink: #e7eefb;
    --muted: #9fb2d3;
    --line: #1d3361;
    --ice: #142a52;
    --cue-bg: #13305e;
    --cue-ink: #a9c8f5;
    --royal: #6aa0f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.5rem;
  padding: calc(env(safe-area-inset-top) + 0.5rem) 0.75rem 0.5rem;
  background: var(--navy);
  color: #fff;
}
.topbar-title { flex: 1; display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; font-weight: 600; }
.topbar-title > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.he-small { font-family: var(--he); font-weight: 500; font-size: 1.1rem; color: var(--mist); }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: transparent; border: 0; color: inherit; cursor: pointer;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.12); }
.icon-btn .icon { width: 24px; height: 24px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: var(--mist); }
.brand-mark img { width: 34px; height: 34px; border-radius: 9px; display: block; }

/* ---------------------------------------------------------------- Layout */
.page { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem calc(env(safe-area-inset-bottom) + 3rem); }
.section-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 1.75rem 0.25rem 0.75rem; }
.fine { color: var(--muted); font-size: 0.88rem; margin: 0.75rem 0.25rem; }

/* ---------------------------------------------------------------- Home */
.hero {
  margin: -1rem -1rem 0; padding: 1.25rem 1.25rem 1.5rem;
  background: linear-gradient(170deg, var(--navy) 0%, var(--deep) 55%, #1a4f9f 100%);
  color: #fff;
  border-radius: 0 0 28px 28px;
}
.hero-date { margin: 0; color: var(--mist); font-size: 0.85rem; font-weight: 500; }
.hero h1 { margin: 0.25rem 0 0.25rem; font-size: 2.1rem; letter-spacing: -0.02em; }
.hero-lead { margin: 0 0 1.25rem; color: #d6e4fb; max-width: 26rem; }
.now-card {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.9rem 1rem; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}
.now-card:active { background: rgba(255, 255, 255, 0.16); }
.now-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sky); color: #fff; }
.now-text { flex: 1; display: flex; flex-direction: column; }
.now-label { font-size: 0.78rem; color: var(--mist); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.now-title { font-weight: 600; }
.now-he { font-family: var(--he); font-size: 1.5rem; }

.event-card {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 0.6rem;
  padding: 0.75rem 1rem; border-radius: var(--radius);
  background: rgba(201, 162, 74, 0.16); border: 1px solid rgba(201, 162, 74, 0.45);
}
.event-card > .icon:first-child { width: 28px; height: 28px; color: #f1d58f; }
.event-card .chev { color: #f1d58f; }
.event-title { font-weight: 600; }
.event-sub { font-size: 0.82rem; color: #e9dcb8; }

.bubble { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--ice); color: var(--gold); flex: none; }
.holiday-hero { background: linear-gradient(160deg, #1a4f9f 0%, #12336b 50%, #0b2147 100%); }
.holiday-hero .service-icon { color: #f1d58f; }
.hero-status { display: inline-block; margin: 0.75rem 0 0; padding: 0.3rem 0.7rem; border-radius: 999px; background: rgba(201, 162, 74, 0.22); color: #f6e3ad; font-size: 0.85rem; font-weight: 600; }
.summary.intro { margin-top: 1.25rem; }
.today-card {
  display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1rem;
  padding: 0.75rem 0.9rem; border-radius: var(--radius);
  background: rgba(201, 162, 74, 0.14); border: 1px solid rgba(201, 162, 74, 0.5); color: var(--ink); font-size: 0.92rem;
}
.today-card > .icon:first-child { color: var(--gold); width: 24px; height: 24px; }
.today-card > span { flex: 1; }

.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.service-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
  padding: 0.9rem 0.8rem; border-radius: var(--radius);
  color: #fff; box-shadow: var(--shadow); min-height: 9.5rem;
}
.service-card:active { transform: scale(0.98); }
.shacharit { background: linear-gradient(160deg, #4a8ae8, #1f5fbf); }
.mincha { background: linear-gradient(160deg, #2f6fd0, #12408f); }
.arvit { background: linear-gradient(160deg, #1a3f80, #0b2147); }
.service-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.18); margin-bottom: auto; }
.service-icon.big { width: 52px; height: 52px; border-radius: 14px; }
.service-icon.big .icon { width: 28px; height: 28px; }
.service-he { font-family: var(--he); font-size: 1.45rem; line-height: 1.2; margin-top: 0.75rem; }
.service-title { font-weight: 700; }
.service-sub { font-size: 0.8rem; opacity: 0.85; }

.group { margin-bottom: 1rem; }
.group-title { display: flex; align-items: center; gap: 0.45rem; font-size: 1rem; margin: 0 0.25rem 0.5rem; color: var(--royal); }

.row-card {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 0.9rem; margin-bottom: 0.5rem;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.row-card:active { background: var(--ice); }
.step { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ice); color: var(--royal); font-weight: 700; font-size: 0.9rem; flex: none; }
.row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 0.85rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-he { font-family: var(--he); font-size: 1.2rem; color: var(--royal); white-space: nowrap; }
.chev { color: var(--mist); }

.about-link { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; padding: 1rem; color: var(--royal); font-weight: 600; }

/* ---------------------------------------------------------------- Service */
.service-hero { margin: -1rem -1rem 0; padding: 1.5rem 1.25rem; color: #fff; border-radius: 0 0 28px 28px; }
.service-hero h1 { margin: 0.75rem 0 0; font-size: 2rem; }
.service-hero .service-sub { font-size: 1rem; margin: 0; }
.when { margin: 0.75rem 0 0; font-size: 0.92rem; color: #e1ecfd; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 52px; padding: 0 1.25rem; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--royal); border-color: var(--royal); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { background: #2f6fd0; border-color: #2f6fd0; } }
.btn.wide { display: flex; width: 100%; margin-top: 1rem; }

/* ---------------------------------------------------------------- Prayer toolbar */
.toolbar {
  position: sticky; top: calc(env(safe-area-inset-top) + 60px); z-index: 15;
  display: flex; gap: 0.4rem; padding: 0.55rem 0.75rem; overflow-x: auto;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 0.35rem;
  min-height: 38px; padding: 0 0.9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.chip [lang="he"] { font-family: var(--he); font-size: 1.05rem; }
.chip.on { background: var(--royal); border-color: var(--royal); color: #fff; }
.chip.why-all { margin-left: auto; color: var(--royal); }
.chip .icon { width: 1.1em; height: 1.1em; }

/* ---------------------------------------------------------------- Prayer page */
.crumb { margin: 0.25rem 0.25rem 0; font-size: 0.8rem; font-weight: 600; color: var(--royal); text-transform: uppercase; letter-spacing: 0.06em; }
.summary { margin: 0.4rem 0.25rem 1rem; font-size: 1.05rem; color: var(--ink); }
.howto { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.25rem 1rem; margin-bottom: 1.25rem; }
.howto summary { display: flex; align-items: center; gap: 0.5rem; min-height: 48px; font-weight: 600; color: var(--royal); cursor: pointer; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 400; }
.howto[open] summary::after { content: "–"; }
.howto ol { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--ink); }
.howto li { margin-bottom: 0.45rem; }

.lines { display: flex; flex-direction: column; gap: 0.6rem; }
.line-heading {
  margin: 1.25rem 0.25rem 0.1rem; font-size: 0.85rem; font-weight: 700; color: var(--royal);
  letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.6rem;
}
.line-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.line {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0.9rem 1rem; scroll-margin-top: 130px;
}
.he { font-family: var(--he); font-size: var(--he-size); line-height: 1.75; margin: 0; text-align: right; color: var(--ink); }
.tr { font-size: var(--tr-size); font-style: italic; color: var(--royal); margin: 0.35rem 0 0; font-weight: 500; }
.en { font-size: var(--en-size); color: var(--muted); margin: 0.3rem 0 0; }
.hide-he .he, .hide-tr .tr, .hide-en .en { display: none; }
.hide-he .line .tr { margin-top: 0; }
.hide-he.hide-tr .line .en { margin-top: 0; color: var(--ink); }

.cue {
  display: flex; gap: 0.5rem; align-items: flex-start;
  margin: 0 0 0.6rem; padding: 0.55rem 0.7rem; border-radius: 12px;
  background: var(--cue-bg); color: var(--cue-ink); font-size: 0.9rem; font-weight: 500;
}
.cue .icon { margin-top: 0.1rem; }
.cue.standalone { margin: 0.25rem 0; }
.cue.inline { display: inline-flex; margin: 0; padding: 0.2rem 0.5rem; }
.note { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; padding-left: 0.65rem; border-left: 3px solid var(--mist); }
.why-btn {
  margin-top: 0.6rem; padding: 0.3rem 0.8rem; min-height: 34px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--royal); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.why { margin: 0.6rem 0 0; padding: 0.7rem 0.85rem; border-radius: 12px; background: var(--ice); font-size: 0.92rem; color: var(--ink); }

.season { display: flex; flex-direction: column; gap: 0.6rem; border-radius: calc(var(--radius) + 4px); }
.season.current { padding: 0.5rem; background: var(--ice); border: 1px solid var(--mist); }
.season-tag { margin: 0.25rem 0.4rem 0; font-size: 0.78rem; font-weight: 700; color: var(--royal); text-transform: uppercase; letter-spacing: 0.05em; }
.season-other { border-radius: var(--radius); }
.season-other summary { cursor: pointer; padding: 0.6rem 0.4rem; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.season-other .season { opacity: 0.75; }

.end { margin-top: 1.5rem; }
.end .btn .icon { width: 1.1em; height: 1.1em; }
.done { text-align: center; font-weight: 600; color: var(--royal); }

/* ---------------------------------------------------------------- Commentary sheet */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 15, 35, 0.5); animation: fade 0.2s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto;
  max-width: 40rem; margin: 0 auto;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 0.5rem 1.25rem calc(env(safe-area-inset-bottom) + 1.5rem);
  animation: rise 0.25s ease;
}
.sheet-panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0.25rem auto 0.5rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sheet-head h2 { font-size: 1.2rem; margin: 0; color: var(--royal); }
.sheet-head .icon-btn { color: var(--muted); }
.sheet-panel p { margin: 0 0 1rem; line-height: 1.6; }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- Settings and about */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 0.85rem; }
.card-title { font-size: 1rem; margin: 0 0 0.5rem; color: var(--royal); }
.card .fine { margin: 0 0 0.75rem; }
.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch-row input:checked + .switch { background: var(--royal); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--sky); outline-offset: 2px; }
.segs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg { flex: 1 1 auto; min-height: 44px; padding: 0 0.9rem; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg.on { background: var(--royal); border-color: var(--royal); color: #fff; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2rem; margin: 0; }
.prose li { margin-bottom: 0.5rem; }
.demo { margin: 0; }
.demo.en { margin-bottom: 0.75rem; }

/* ---------------------------------------------------------------- Folding sections */
.fold-card {
  margin-top: 1rem; border-radius: calc(var(--radius) + 4px); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.fold-head {
  display: flex; align-items: center; gap: 0.8rem; padding: 1rem; min-height: 76px;
  cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent;
}
.fold-head::-webkit-details-marker { display: none; }
.fold-head:active { background: var(--ice); }
.fold-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none; color: #fff; }
.fold-icon .icon { width: 24px; height: 24px; }
.fold-card.gold .fold-icon { background: linear-gradient(160deg, #e2bd63, #b38a2e); }
.fold-card.blue .fold-icon { background: linear-gradient(160deg, #4a8ae8, #1f5fbf); }
.fold-card.gold { border-top: 4px solid var(--gold); }
.fold-card.blue { border-top: 4px solid var(--royal); }
.fold-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fold-name { font-size: 1.08rem; font-weight: 700; color: var(--ink); }
.fold-sub { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fold-count { flex: none; min-width: 1.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--ice); color: var(--royal); font-size: 0.8rem; font-weight: 700; text-align: center; }
.fold-chev { flex: none; color: var(--muted); transition: transform 0.2s; }
.fold-card[open] .fold-chev { transform: rotate(90deg); }
.fold-card[open] .fold-head { border-bottom: 1px solid var(--line); }
.fold-body { padding: 0.75rem 0.75rem 0.25rem; background: var(--bg); }
.fold-body .row-card { box-shadow: none; border: 1px solid var(--line); }
.fold-body .group { margin-bottom: 0.75rem; }
.fold-body .group-title { margin-top: 0.4rem; }

/* ---------------------------------------------------------------- Video */
.video-btn {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; margin: 0 0 1rem; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  text-align: left; cursor: pointer; font: inherit; color: var(--ink);
}
.video-play { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #e62117; flex: none; }
.video-play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.video-panel {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  max-width: 44rem; margin: 0 auto; padding: 0.5rem 0.75rem 0.9rem;
  background: var(--card); border-radius: 20px; animation: fade 0.2s ease;
}
.video-panel .sheet-head h2 { font-size: 1rem; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------- Food finder */
.finder { margin-bottom: 1.25rem; }
.finder-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--royal); margin-bottom: 0.6rem; }
.finder-input {
  width: 100%; min-height: 50px; padding: 0 1rem; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 1.05rem;
}
.finder-input:focus { outline: none; border-color: var(--royal); }
.food-hit { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.food-name { margin: 0 0 0.4rem; font-weight: 700; font-size: 1.05rem; }
.food-row {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  padding: 0.6rem 0.75rem; margin-bottom: 0.4rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--ice); cursor: pointer;
}
div.food-row { cursor: default; }
.food-when { flex: none; width: 3.6rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.food-what { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.food-what em { color: var(--royal); font-size: 0.9rem; }
.food-sub { color: var(--muted); font-size: 0.82rem; }
.he-inline { font-family: var(--he); font-size: 1.15rem; line-height: 1.4; }
.food-none { margin-top: 0.75rem; font-size: 0.92rem; }
.food-none ul { padding-left: 1.2rem; margin: 0.4rem 0 0; }
.food-none li { margin-bottom: 0.3rem; }
.line.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: var(--shadow); } }

/* ---------------------------------------------------------------- Calendar */
.card-kicker { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); }
.shabbat-card { border-top: 4px solid var(--gold); }
.parasha { margin-bottom: 0.75rem; }
.parasha-name { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.parasha-name .he-inline { color: var(--royal); font-weight: 500; }
.parasha-book { margin: 0.1rem 0 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.parasha-sum { margin: 0 0 0.5rem; line-height: 1.55; }
.rashi { margin: 0.9rem 0 0.75rem; padding: 0.85rem 0.95rem; border-radius: 14px; background: var(--ice); border-left: 4px solid var(--gold); }
.rashi-kicker { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--royal); }
.rashi blockquote { margin: 0; }
.rashi-he { margin: 0 0 0.5rem; font-family: var(--he); font-size: 1.15rem; line-height: 1.7; text-align: right; color: var(--ink); }
.rashi-en { margin: 0; font-style: italic; line-height: 1.55; color: var(--ink); }
.rashi figcaption { margin-top: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.rashi-lesson { margin: 0.6rem 0 0; font-size: 0.92rem; }
.hide-he .rashi-he { display: none; }
.special { margin: 0 0 0.6rem; font-weight: 600; color: var(--royal); }
.special [lang="he"] { font-family: var(--he); }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.5rem 0; }
.time { display: flex; flex-direction: column; padding: 0.7rem 0.8rem; border-radius: 14px; background: var(--ice); }
.time-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.time-value { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.time-sub { font-size: 0.75rem; color: var(--muted); }
.loc-line { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; font-size: 0.88rem; color: var(--royal); font-weight: 600; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.cal-head .icon-btn { color: var(--royal); }
.cal-title { display: flex; flex-direction: column; align-items: center; }
.cal-title span { font-size: 0.8rem; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--muted); padding: 0.2rem 0; }
.cal-dow.shabbat { color: var(--gold); }
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 3.4rem; padding: 0.3rem 0 0.2rem; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font: inherit;
}
.cal-day .g { font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
.cal-day .h { font-family: var(--he); font-size: 0.78rem; color: var(--muted); line-height: 1.2; }
.cal-day.other { opacity: 0.35; }
.cal-day.shabbat { background: rgba(201, 162, 74, 0.1); }
.cal-day.today .g { color: #fff; background: var(--royal); border-radius: 999px; padding: 0 0.4rem; }
.cal-day.sel { outline: 2px solid var(--royal); outline-offset: -2px; }
.dots { display: flex; gap: 2px; margin-top: 2px; min-height: 6px; }
.dots i, .ev-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sky); display: block; flex: none; }
.dots i.yt, .ev-dot.yt { background: var(--gold); }
.dots i.roshchodesh, .ev-dot.roshchodesh { background: #7c9cc9; }
.dots i.parashat, .ev-dot.parashat { background: var(--mist); }
.day-time { display: flex; justify-content: space-between; gap: 1rem; margin: 0.25rem 0; padding: 0.5rem 0.75rem; border-radius: 10px; background: var(--ice); font-size: 0.92rem; }
.ev { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.ev-text { flex: 1; display: flex; flex-direction: column; }
.ev .he-inline { font-size: 1rem; color: var(--royal); }
.select {
  width: 100%; min-height: 48px; padding: 0 0.8rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit;
}
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------------------------------------------------------------- Alarm */
.alarm-card {
  margin: 0 0 1.1rem; padding: 0.7rem 0.9rem; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
}
.alarm-card-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mist); }
.alarm-card-head > span, .alarm-card-head a { display: inline-flex; align-items: center; gap: 0.35rem; }
.alarm-card-head a { color: #fff; text-transform: none; letter-spacing: 0; font-weight: 600; min-height: 36px; }
.alarm-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 0; }
.alarm-row + .alarm-row { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.alarm-row.light + .alarm-row.light { border-top-color: var(--line); }
.alarm-row-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.alarm-time { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.alarm-time.off { opacity: 0.45; }
.alarm-sub { font-size: 0.85rem; opacity: 0.8; }
.alarm-next { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--mist); }
.alarm-add { display: flex; align-items: center; gap: 0.5rem; min-height: 48px; margin-top: 0.3rem; font-weight: 600; color: #fff; }
.alarm-switch {
  flex: none; position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.25); transition: background 0.2s;
}
.alarm-row.light .alarm-switch { background: var(--line); }
.alarm-switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.alarm-switch.on, .alarm-row.light .alarm-switch.on { background: var(--gold); }
.alarm-switch.on span { transform: translateX(20px); }

.alarm-input {
  width: 100%; min-height: 64px; padding: 0 1rem; margin-bottom: 0.5rem; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 2rem; font-weight: 700; text-align: center;
}
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; }
.day-chip { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.day-chip.on { background: var(--royal); border-color: var(--royal); color: #fff; }
.label-chips { margin-top: 0.5rem; }
.label-chips .seg { flex: 0 1 auto; min-height: 38px; font-size: 0.85rem; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.btn.danger { color: #c0392b; }
.ok { display: flex; align-items: center; gap: 0.4rem; color: var(--royal); font-weight: 600; }

.alarm-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(11, 33, 71, 0.92); color: #fff; animation: fade 0.2s ease;
}
.alarm-ring { text-align: center; padding: 2rem; }
.alarm-bell { font-size: 4.5rem; animation: shake 0.5s ease-in-out infinite; }
.alarm-label { margin: 0.75rem 0 0.25rem; font-size: 1.8rem; font-weight: 700; }
.alarm-count { margin: 0; color: var(--mist); }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

body.clock-mode { background: #000; }
.clock-page {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 1.5rem) 1.5rem calc(env(safe-area-inset-bottom) + 1.5rem);
  background: #000; color: #8fa6c9; text-align: center;
}
.clock-time { margin: 0; font-size: clamp(4rem, 22vw, 8rem); font-weight: 300; letter-spacing: -0.04em; line-height: 1; color: #c7d6ee; }
.clock-date { margin: 0.5rem 0 0.15rem; font-size: 1.1rem; }
.clock-hdate { margin: 0 0 1.75rem; font-size: 0.95rem; opacity: 0.8; }
.clock-info { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.clock-next { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--gold); }
.clock-parasha { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 1rem; color: #c7d6ee; }
.clock-note { max-width: 22rem; margin: 1.5rem 0 0; font-size: 0.88rem; opacity: 0.75; }
.clock-warn { max-width: 22rem; margin: 1rem 0 0; padding: 0.75rem; border-radius: 12px; background: rgba(192, 57, 43, 0.2); color: #f5b7b1; font-size: 0.9rem; }
/* Dim: about 95% darker. Black pixels are off on most modern screens. The alarm overlay stays bright. */
.clock-page.dim > * { opacity: 0.06; transition: opacity 0.3s; }
.clock-page { cursor: pointer; }
.clock-exit { margin-top: 2rem; background: transparent; border-color: #22324d; color: #8fa6c9; }

a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

@media (max-width: 360px) {
  .service-card { padding: 0.75rem 0.6rem; }
  .service-he { font-size: 1.25rem; }
  .row-he { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
