/* תהילים בדקה - עיצוב. Sections: tokens, accessibility themes, layout, opening screen (arc, gates), sets of chapters, calendar,
   prayers / Omer / Shabbat times, reminder and news, card, buttons, commentary, chapter view, accessibility menu. */

:root {
  --bg: #f7f3ea;
  --card: #fffdf8;
  --card-line: #efe7d7;
  --accent: #8a7a5c;
  --accent-dark: #6f6248;
  --accent-soft: #f1ebdf;
  --on-accent: #ffffff;
  --track: #ece4d4;
  --ink: #2f2a21;
  --muted: #6b6457;
  --line: #e9e1d0;
  --error-ink: #8f3a2b;
  --error-bg: #fbefe9;
  --error-line: #efd3c7;
  --shadow: 0 1px 2px rgba(70, 52, 20, 0.05), 0 12px 32px rgba(70, 52, 20, 0.09);
  --serif: "David", "Frank Ruehl CLM", "Times New Roman", serif;
  --latin: Georgia, "Times New Roman", serif;
  --gold: #a87b2d;
  --gold-soft: rgba(168, 123, 45, 0.13);
  --night: #3f4f7a;
  --night-soft: rgba(63, 79, 122, 0.12);
  --light-blue: #2a6d9e;
  --a11y-blue: #1d4ed8;
  --fab-size: 84px;
  color-scheme: light;
}

/* accessibility themes (set from the accessibility menu) */
html.a11y-contrast {
  --bg: #ffffff;
  --card: #ffffff;
  --card-line: #000000;
  --accent: #3d3220;
  --accent-dark: #2a2214;
  --accent-soft: #fff3a0;
  --on-accent: #ffffff;
  --track: #e4e4e4;
  --ink: #000000;
  --muted: #1a1a1a;
  --line: #000000;
  --error-ink: #7a0000;
  --error-bg: #ffffff;
  --error-line: #7a0000;
  --gold: #6b4a00;
  --gold-soft: transparent;
  --night: #1a2a5c;
  --light-blue: #0b4a7d;
  --night-soft: transparent;
  --shadow: none;
}

html.a11y-dark {
  --bg: #121212;
  --card: #1d1c1a;
  --card-line: #3a3833;
  --accent: #d9bf8c;
  --accent-dark: #ecd6a8;
  --accent-soft: #2e2a22;
  --on-accent: #1a1712;
  --track: #2a2824;
  --ink: #f3efe6;
  --muted: #d2cbbd;
  --line: #3a3833;
  --error-ink: #ffb4a6;
  --error-bg: #3a1f1a;
  --error-line: #6b3328;
  --gold: #e3bd6a;
  --gold-soft: rgba(227, 189, 106, 0.12);
  --night: #a9b8e4;
  --light-blue: #8cc8f0;
  --night-soft: rgba(169, 184, 228, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

html.a11y-text-1 { font-size: 115%; }
html.a11y-text-2 { font-size: 130%; }
html.a11y-text-3 { font-size: 150%; }

html.a11y-font {
  --serif: Arial, "Segoe UI", Tahoma, "Noto Sans Hebrew", sans-serif;
  --latin: Arial, "Segoe UI", sans-serif;
}

html.a11y-gray .wrap { filter: grayscale(1); }

html.a11y-links a,
html.a11y-links .link-btn {
  background: #fff200 !important;
  color: #000000 !important;
  outline: 2px solid #000000;
  outline-offset: 1px;
  text-decoration: underline !important;
}

html.a11y-spacing .verse,
html.a11y-spacing .translation,
html.a11y-spacing .cv-text,
html.a11y-spacing .cv-en,
html.a11y-spacing .commentator p,
html.a11y-spacing .pr,
html.a11y-spacing .omer-count,
html.a11y-spacing .a11y-dialog p,
html.a11y-spacing .a11y-dialog li {
  line-height: 2.2 !important;
  letter-spacing: 0.06em;
  word-spacing: 0.16em;
}

html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9.5-6.6 1.5L9 20.5z' fill='%23000' stroke='%23fff' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}

html.a11y-still *,
html.a11y-still *::before,
html.a11y-still *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  padding:
    max(18px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(calc(var(--fab-size) + 36px + var(--consent-h, 0px)), env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

/* the search is the first thing on the page, so there is little empty space above it */
.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding-top: clamp(0px, 1.5vh, 20px);
}

.wrap:focus { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 1rem;
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* ---------- header ---------- */

.site-head {
  min-height: 4.7rem; /* room kept for the dedication, so the page does not jump when it appears */
  margin-bottom: 4px;
  text-align: center;
}

.site-head h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.01em;
}
.home-link {
  color: inherit;
  text-decoration: none;
}

/* ---------- search: chapter column + verse column ---------- */

.picker {
  margin-bottom: 16px;
  padding: 14px 18px 16px;
  border: 1px solid var(--card-line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

/* two separate columns; on a very narrow screen or with very large text they stack */
.picker-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8.25rem, 100%), 1fr));
  gap: 10px 14px;
}

.picker-col { min-width: 0; }
.picker .select-wrap { display: block; }
/* the question, on the opening screen only */
.ask-title {
  margin: 0 0 14px;
  font-size: 1.875rem;
  line-height: 1.3;
  color: var(--accent-dark);
  text-align: center;
}

/* opening screen: the search is the main thing, so it is bigger */
.is-home .picker {
  margin-top: 10px;
  padding-block: 10px 14px;
}

.is-home .ask-title { margin-bottom: 8px; }

.is-home .chapter-select {
  min-height: 52px;
  font-size: 1.25rem;
}

/* where the reader stopped */
.resume {
  margin: 2px 0 -8px;
  text-align: center;
}

.resume-btn {
  min-height: 30px;
  padding: 3px 8px;
  font-weight: 700;
}

.resume-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 10px;
}

.resume-bar {
  flex: 0 1 8rem;
  height: 4px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}

.resume-bar span {
  display: block;
  width: calc(var(--read, 0) * 100%);
  min-width: 4px;
  height: 100%;
  border-radius: 4px;
  background: var(--gold);
}

.resume-count {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--muted);
}

.home-btn {
  display: block;
  min-height: 40px;
  margin: 8px auto -6px;
  padding: 6px 12px;
  font-size: 0.9375rem;
}

/* ---------- opening screen: the arc of the day, with the date inside ---------- */

.sky {
  max-width: 22rem;
  margin: 4px auto 0;
  text-align: center;
  line-height: 1.4;
}

.sky p { margin: 0; }

.sky-arc { position: relative; }

/* a soft light behind the arc: gold by day, blue by night */
.sky-arc::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 340 / 130; /* down to the horizon, like the drawing in index.html */
  background: radial-gradient(50% 92% at 50% 100%, var(--gold-soft), transparent 100%);
  pointer-events: none;
}

.sky.is-night .sky-arc::before { background: radial-gradient(50% 92% at 50% 100%, var(--night-soft), transparent 100%); }
.sky.no-arc .sky-arc::before { display: none; }

.sky-arc svg {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.sky-path,
.sky-done,
.sky-horizon,
.sky-rays {
  fill: none;
  stroke-linecap: round;
}

.sky-path {
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 0.1 6;
  opacity: 0.7;
}

.sky-done { stroke: var(--gold); stroke-width: 2.4; }
.sky-horizon { stroke: var(--line); stroke-width: 1.5; }
.sky-rays { stroke: var(--gold); stroke-width: 1.8; }
.sky-gap { fill: var(--bg); } /* the line stops just before the sun or the moon */
.sky-disc { fill: var(--gold); }
.sky-glow { fill: var(--gold); opacity: 0.16; }

.sky-moon { display: none; }
.sky.is-night .sky-moon { display: inline; }
.sky.is-night .sky-sun { display: none; }
.sky.is-night .sky-disc,
.sky.is-night .sky-glow { fill: var(--night); }
.sky.is-night .sky-done { stroke: var(--night); }

/* inside the arc, between Pesach and Shavuot: the count of the Omer */
.sky-omer {
  min-height: 1.75rem;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* inside the arc */
.sky-date {
  position: absolute;
  inset-inline: 10%;
  bottom: 15%;
}

.today-heb {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.today-civil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 8px;
  color: var(--muted);
}

.today-clock::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

/* under the horizon: where the arc begins and ends, and the country between them */
.sky-ends {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 8px;
  min-height: 2.9rem;
  padding-inline: 2%;
}

.sky-end {
  min-width: 3.2rem;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--muted);
}

.sky-end span { display: block; }

.sky-end b {
  font-size: 1rem;
  color: var(--ink);
}

.today-place {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 4px;
}

.place-wrap {
  position: relative;
  max-width: 100%;
}

.place-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 9px;
  width: 6px;
  height: 6px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.place-select {
  width: 8.5rem;
  max-width: 100%;
  min-height: 40px;
  padding: 2px 8px;
  padding-inline-end: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  text-align: center;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.place-select option,
.place-select optgroup {
  background: var(--card);
  color: var(--ink);
}

/* as wide as the chosen name, where the browser knows how */
@supports (field-sizing: content) {
  .place-select {
    width: auto;
    field-sizing: content;
  }
}

/* one quiet line: the time that is left, and the nearest event */
.sky-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 16px;
  min-height: 1.5rem;
  margin-top: 2px;
  font-size: 1rem;
  color: var(--muted);
}

.sky-events {
  min-height: 1.5rem;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
  cursor: pointer;
}

.sky-events:empty { display: none; }
.sky-event { display: block; }

/* a day without a sunrise: only the date and the country */
.sky.no-arc svg,
.sky.no-arc .sky-end,
.sky.no-arc .sky-text { display: none; }

.sky.no-arc .sky-ends { grid-template-columns: 1fr; }

/* large text does not fit inside the arc: it moves below it */
.sky.no-arc .sky-date,
html.a11y-text-2 .sky-date,
html.a11y-text-3 .sky-date,
html.a11y-spacing .sky-date { position: static; }

/* "stop animations": the parts that move by themselves are hidden, so nothing on the page changes by itself */
html.a11y-still .today-clock,
html.a11y-still .sky-text,
html.a11y-still .sky-done,
html.a11y-still #skyBody { display: none; }

/* ---------- opening screen: the gates ---------- */

.gates {
  max-width: 30rem;
  margin: 10px auto 0;
}

.gates-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--accent-dark);
}

.gates-title::before,
.gates-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, var(--accent), transparent);
}

.gates-title::before { background: linear-gradient(to right, var(--accent), transparent); }

.gate-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

html.a11y-text-2 .gate-list,
html.a11y-text-3 .gate-list { grid-template-columns: repeat(2, 1fr); }

.gate-list li { display: grid; min-width: 0; }

/* an arch of stone: a round top, an inner line, and light that comes from inside */
.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  min-height: 5.75rem;
  padding: 10px 6px 6px;
  border: 1.5px solid var(--accent);
  border-bottom-width: 3px;
  border-radius: 999px 999px 12px 12px;
  background: radial-gradient(90% 62% at 50% 34%, var(--gold-soft), transparent 100%), var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 4px 4px 3px;
  border: 1px solid var(--accent);
  border-radius: 999px 999px 9px 9px;
  opacity: 0.3;
  pointer-events: none;
}

.gate:disabled { cursor: default; }

.gate-icon {
  flex: none;
  width: 2rem;
  height: 2rem;
  margin-bottom: 2px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate-flame { fill: var(--gold-soft); }

.gate-name {
  max-width: 100%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.gate-sub {
  max-width: 100%;
  font-size: 0.8125rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* after a big update, for a visitor who cannot be remembered */
.news-pill {
  display: block;
  min-height: 36px;
  margin: 0 auto 6px;
  padding: 4px 18px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

html.a11y-contrast .news-pill { background: var(--card); }

/* ---------- rows of an old book's table of contents (the events of a month) ---------- */

.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  width: 100%;
  min-height: 52px;
  padding: 11px 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.toc-row:disabled { cursor: default; }

.toc-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.toc-dots {
  flex: 1;
  min-width: 20px;
  height: 0;
  border-bottom: 2px dotted var(--accent);
  opacity: 0.5;
}

.toc-page {
  font-size: 1.0625rem;
  color: var(--muted);
}

/* ---------- a set of chapters on one page ---------- */

.set-part { margin-top: 22px; }

.set-part-title {
  margin: 0 0 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 1.3125rem;
  color: var(--accent-dark);
  text-align: center;
}

#setChapters { transition: opacity 0.2s ease; }
#setChapters[aria-busy="true"] { opacity: 0.45; }

.chapter-title:focus { outline: none; }

.tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--track);
}

.tab {
  min-height: 40px;
  padding: 4px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 1.0625rem;
  cursor: pointer;
}

.tab[aria-pressed="true"] {
  background: var(--card);
  box-shadow: 0 1px 4px rgba(70, 52, 20, 0.18);
  font-weight: 700;
}

.needs { margin-top: 18px; }

.need-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(6rem, 100%), 1fr));
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.need-list li { display: grid; }

.need {
  min-height: 4rem;
  padding: 8px 6px;
  border: 1.5px solid var(--card-line);
  border-bottom: 2px solid var(--gold);
  border-radius: 14px 14px 10px 10px;
  background: radial-gradient(80% 90% at 50% 100%, var(--gold-soft), transparent 100%), var(--card);
  color: var(--accent-dark);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html.a11y-contrast .need { border-color: var(--line); }

/* ---------- holiday calendar ---------- */

.luach-ahead {
  margin-top: 12px;
  text-align: center;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gold);
}

.luach-ahead p { margin: 0; }

.luach {
  width: 100%;
  margin-top: 12px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.luach th {
  padding: 4px 0 8px;
  font-size: min(0.9375rem, 4.6vw);
  color: var(--muted);
}

.luach abbr { text-decoration: none; }

.luach td {
  position: relative;
  height: 5.25rem;
  padding: 2px;
  vertical-align: top;
}

.luach-day {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 4.75rem;
  padding: 4px 1px 16px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* the vw limits keep large text inside the squares of a narrow phone */
.luach-heb { font-size: min(1.125rem, 6.4vw); font-weight: 700; }
.luach-civil { font-size: min(0.8125rem, 4vw); color: var(--muted); }

/* the name of the event: only where there is room for it */
.luach-name {
  display: none;
  max-width: 100%;
  margin-top: 1px;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.luach .is-shabbat .luach-day { background: var(--accent-soft); }
.luach .is-past .luach-day { border-color: transparent; }
.luach .is-past .luach-heb { color: var(--muted); font-weight: 400; }

/* a holiday: a gold frame */
.luach .is-chag .luach-day { border-color: var(--gold); background: var(--gold-soft); }
.luach .is-chag .luach-heb { color: var(--accent-dark); }

/* the drawing of the event (js/symbols.js) */
.symbol {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.symbol-fill { fill: var(--gold); stroke: none; }

.luach .symbol {
  width: min(1.375rem, 7vw);
  height: min(1.375rem, 7vw);
  margin-top: 2px;
}

.luach .is-fast .symbol,
.luach .is-memory .symbol,
.luach .is-rc .symbol { stroke: var(--accent); }

.luach .is-fast .symbol-fill,
.luach .is-memory .symbol-fill,
.luach .is-rc .symbol-fill { fill: var(--accent); }

.luach .is-today .symbol { stroke: var(--card); }
.luach .is-today .symbol-fill { fill: var(--card); }

.luach-ahead .symbol,
.luach-panel-symbols .symbol {
  width: 3rem;
  height: 3rem;
  stroke-width: 1.4;
}

.luach-panel-symbols {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.luach-panel-symbols:empty { display: none; }

#luachEvents .symbol { align-self: center; }

/* a hillula: a small candle, or on a holiday a small flame beside its symbol. The names are under the table */
.luach .luach-candle {
  width: min(1.125rem, 5.6vw);
  height: min(1.125rem, 5.6vw);
  opacity: 0.8;
}

.luach-hil {
  position: absolute;
  bottom: 20px;
  inset-inline-end: 4px;
  width: 6px;
  height: 6px;
  border-radius: 0 60% 60% 60%;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.85;
}

.luach .is-today .luach-hil { background: var(--card); }

.hil-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.hil-list:empty { display: none; }

.hil {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 2px 0;
  line-height: 1.4;
  text-align: start;
}

.hil .symbol { margin-top: 1px; }
.hil .hil-card { flex: none; min-height: 44px; margin-top: -11px; padding-inline: 8px; }
.hil-name { color: var(--accent-dark); }
.hil-about { color: var(--muted); }
html.a11y-contrast .hil-name,
html.a11y-contrast .hil-about { color: #000000; }

.luach-hillulot { margin-top: 18px; }
#luachHillulotList .toc-row { min-height: 44px; padding-block: 6px; }
#luachHillulotList .toc-name { font-size: 1.0625rem; }
#luachHillulotList .toc-page { font-size: 0.9375rem; }

/* the way from today to the holiday, under the squares */
.luach .is-road::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  bottom: 7px;
  border-bottom: 2.5px dotted var(--gold);
  pointer-events: none;
}

.luach .is-today.is-road::before { inset-inline-start: calc(var(--day, 0) * 100%); }

/* the square of today */
.luach .is-today .luach-day {
  border: 2px solid var(--accent-dark);
  background: var(--accent-dark);
}

.luach .is-today .luach-heb,
.luach .is-today .luach-civil,
.luach .is-today .luach-name { color: var(--card); }

.luach .is-today .luach-heb { font-weight: 700; }

/* today's sun: it walks along the square from sunset to sunset */
.luach-sun {
  position: absolute;
  z-index: 3;
  bottom: 1px;
  inset-inline-start: calc(var(--day, 0) * (100% - 14px));
  width: 14px;
  height: 14px;
  border: 2.5px solid var(--card);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1.5px var(--gold), 0 0 10px 2px var(--gold);
  pointer-events: none;
}

/* the holiday at the end of the road */
.luach .is-target .luach-day {
  border: 2px solid var(--gold);
  background: radial-gradient(90% 80% at 50% 40%, var(--gold-soft), transparent 100%), var(--gold-soft);
  box-shadow: 0 0 14px 1px var(--gold-soft);
}

.luach .is-today .luach-day[aria-pressed="true"] { outline: 0; }

.luach-day[aria-pressed="true"] {
  outline: 2px solid var(--accent-dark);
  outline-offset: 1px;
}

.luach-day:focus-visible,
.luach .is-today .luach-day:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.luach-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  text-align: center;
}

.luach-panel p { margin: 0; }
.luach-panel-title { font-size: 1.1875rem; font-weight: 700; color: var(--accent-dark); }
.luach-panel-meta { color: var(--muted); }
.luach-panel-events { font-weight: 700; color: var(--accent-dark); }
.luach-panel-events:empty { display: none; }
.luach-panel .links { margin-top: 4px; }

html.a11y-contrast .luach-panel { color: #000000; }
html.a11y-contrast .luach-panel .link-btn,
html.a11y-contrast .luach-panel-title,
html.a11y-contrast .luach-panel-events,
html.a11y-contrast .luach-panel-meta { color: #000000; }

#luachEvents { margin-top: 10px; }
#luachEvents .toc-row { min-height: 46px; padding-block: 7px; }
#luachEvents .toc-name { font-size: 1.125rem; }
#luachEvents .toc-page { font-size: 1rem; }

/* "stop animations": the sun does not move by itself */
html.a11y-still .luach-sun { display: none; }
html.a11y-still .luach .is-today.is-road::before { inset-inline-start: 0; }

@media (min-width: 600px) {
  .luach td { height: 6.5rem; }
  .luach-name { display: block; }

}

/* narrow screens: the table takes the whole width of the card */
@media (max-width: 340px) {
  .gate-list { grid-template-columns: repeat(2, 1fr); }
}

/* on a wide screen there is room: the opening screen is airy again */
@media (min-width: 601px) and (min-height: 481px) {
  .sky { max-width: 23rem; margin-top: 10px; }
  .is-home .picker { margin-top: 18px; padding-block: 16px 20px; }
  .is-home .ask-title { margin-bottom: 12px; }
  .gates { margin-top: 16px; }
  .gate-list { gap: 12px; }
  .gate { min-height: 6.75rem; padding-top: 16px; }
}

@media (max-width: 420px) {
  #luachTable { margin-inline: -14px; }
  .luach td { padding: 1.5px; }
}

/* ---------- tehillim by name ---------- */

.name-form { margin-top: 16px; }

.name-label {
  display: block;
  margin-bottom: 6px;
  font-size: 1.125rem;
  color: var(--muted);
  text-align: center;
}

.name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.name-input {
  flex: 1 1 9rem;
  min-width: 0;
  min-height: 52px;
  padding: 6px 18px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  text-align: center;
}

.name-line .name-go {
  flex: 0 1 auto;
  padding-inline: 22px;
}

.name-extra {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 20px;
  margin-top: 8px;
}

.name-note {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.link-btn.share-btn,
.link-btn.tool-btn { padding: 10px 4px; }

.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--fab-size) + 16px);
  z-index: 58;
  width: fit-content;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  visibility: hidden;
}

.toast.is-on { visibility: visible; }

/* random verse / chapter: small, on the side */
.random-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  margin-top: 6px;
}

.random-pair {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
}

.random-row .link-btn {
  min-height: 40px;
  padding: 6px 8px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.random-row .link-btn:disabled,
.links .link-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- prayers, the Omer, Shabbat times: one view ---------- */

.page-body {
  margin-top: 16px;
  transition: opacity 0.2s ease;
}

.page-body[aria-busy="true"] { opacity: 0.45; }

.pr {
  margin: 0 0 14px;
  font-size: 1.375rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.pr strong { color: var(--accent-dark); }

/* an instruction: small, and without nikud in the source */
.pr-note,
.pr-n {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.pr-note { margin-bottom: 6px; }

/* said only on some days: beside a line, so the eye can skip it */
.pr-add {
  padding-inline-start: 12px;
  border-inline-start: 2px solid var(--accent);
  font-size: 1.25rem;
}

.pr-title {
  margin: 22px 0 6px;
  font-size: 1.25rem;
  color: var(--accent-dark);
  text-align: center;
}

.pr-verse .pr-n {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.pr-details { margin-bottom: 12px; }

.pr-details summary {
  display: inline-block;
  min-height: 40px;
  padding: 6px 4px;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}

.pr-details summary::-webkit-details-marker { display: none; }

.pr-group:first-child .set-part-title {
  padding-top: 0;
  border-top: 0;
}

/* the Omer: seven weeks of seven days */
.omer-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 11rem;
  margin: 0 auto 10px;
}

.omer-dot {
  aspect-ratio: 1;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  opacity: 0.45;
}

.omer-dot.is-done {
  background: var(--gold);
  opacity: 0.55;
}

.omer-dot.is-now {
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  opacity: 1;
}

.omer-sefira {
  margin: 0 0 14px;
  font-size: 1.125rem;
  color: var(--muted);
  text-align: center;
}

.omer-count {
  margin: 16px 0;
  padding: 16px 14px;
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  background: var(--gold-soft);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

html.a11y-contrast .omer-count { background: var(--card); }

/* Shabbat and holiday times */
.shabbat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 14px;
}

.shabbat-form .picker-col { flex: 1 1 8rem; }
.shabbat-form .picker-col:last-child { flex-basis: 100%; }

.shabbat-label {
  display: block;
  margin-bottom: 2px;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
}

.shabbat-form .chapter-select { font-size: 1.0625rem; }

.time-card {
  padding: 22px 18px 10px;
  border: 1.5px solid var(--gold);
  border-radius: 50% 50% 16px 16px / 72px 72px 16px 16px;
  background: radial-gradient(90% 70% at 50% 20%, var(--gold-soft), transparent 100%), var(--card);
}

.time-head {
  margin: 10px 0 8px;
  font-size: 1.375rem;
  line-height: 1.3;
  color: var(--accent-dark);
  text-align: center;
}

.time-heb {
  margin: -4px 0 8px;
  color: var(--muted);
  text-align: center;
}

.time-row,
.time-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.time-name { min-width: 0; }
.time-title { display: block; font-weight: 700; }
.time-when { display: block; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); }

.time-clock {
  font-size: 1.625rem;
  line-height: 1.2;
  color: var(--accent-dark);
}

.time-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  color: var(--ink);
}

.time-more .time-next:first-of-type { border-top: 0; }
.time-more { margin-top: 22px; }
.time-card + .time-more { margin-bottom: 14px; }

/* ---------- daily reminder, news ---------- */

.remind { text-align: center; }

.remind-clock {
  display: grid;
  grid-template-columns: 6.5rem auto 6.5rem;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.5rem;
}

.remind-toggle { margin-top: 6px; }
.a11y-dialog.remind .name-note { min-height: 1.5rem; font-size: 0.9375rem; text-align: center; }

/* a box that pops up, with an X in its corner */
.a11y-dialog.news {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 1.5px solid var(--gold);
  border-radius: 22px;
}

.a11y-dialog.news[open] { animation: news-pop 0.28s ease-out; }

@keyframes news-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.news-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 56px 10px;
  border-bottom: 1.5px solid var(--gold);
  background: linear-gradient(var(--gold-soft), var(--gold-soft)), var(--card);
  text-align: center;
}

.news-x {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--card);
  color: var(--accent-dark);
  cursor: pointer;
}

.news-x svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.news-sun {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto;
  fill: var(--gold-soft);
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.a11y-dialog .news-head h2 { margin: 0; line-height: 1.3; }
.a11y-dialog .news-date { margin: 0; line-height: 1.4; color: var(--muted); }
.news-inside { padding: 10px 20px 12px; }
.a11y-dialog .news-intro { margin: 0 0 4px; font-weight: 700; text-align: center; }

.news-list {
  margin: 0;
  list-style: none;
}

.a11y-dialog .news-list { padding: 0; }

.news-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.a11y-dialog .news-name { margin: 0; font-size: 1.0625rem; line-height: 1.4; color: var(--accent-dark); }
.a11y-dialog .news-text { grid-column: 1; margin: 0; font-size: 1rem; line-height: 1.4; color: var(--muted); }
.news-open { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 6px 4px; }

/* ---------- a picture to share ---------- */

.time-shared {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 18px;
  margin-bottom: 14px;
  color: var(--muted);
}

.time-shared p { margin: 0; }
.time-shared .link-btn { min-height: 44px; }

/* ---------- the card of a day ---------- */

.a11y-dialog.day-dialog {
  width: min(460px, calc(100vw - 24px));
  padding: 12px 18px 18px;
  border: 1.5px solid var(--gold);
  border-radius: 22px;
  text-align: center;
}

.day-bar {
  position: sticky;
  top: -12px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -12px -18px 10px;
  padding: 10px 18px;
  background: var(--card);
}

.day-x { position: static; margin-inline-start: auto; }

/* a gate, like the cards of Shabbat times */
.day-gate {
  padding: 26px 16px 12px;
  border: 1.5px solid var(--gold);
  border-radius: 50% 50% 16px 16px / 72px 72px 16px 16px;
  background: radial-gradient(90% 60% at 50% 20%, var(--gold-soft), transparent 100%), var(--card);
}

.day-symbol .symbol {
  width: 7rem;
  height: 7rem;
  stroke-width: 1.15;
}

.a11y-dialog .day-title { margin: 6px 0 0; font-size: 1.875rem; line-height: 1.2; text-wrap: balance; }
.a11y-dialog .day-gate p { margin: 0; line-height: 1.4; }
.a11y-dialog .day-sub { font-size: 1.1875rem; color: var(--muted); }
.a11y-dialog .day-heb { font-size: 1.5rem; color: var(--ink); }
.a11y-dialog .day-week { font-size: 1.125rem; color: var(--muted); }
.a11y-dialog .day-civil { font-size: 1rem; color: var(--muted); }

.day-notes {
  margin: 8px 0 0;
  list-style: none;
}

.a11y-dialog .day-notes { padding: 0; margin-bottom: 0; }
.a11y-dialog .day-notes li { line-height: 1.5; color: var(--accent-dark); }
.day-notes:empty { display: none; }
.day-times { margin-top: 10px; text-align: start; }
.day-times:empty { display: none; }
.a11y-dialog .time-place { text-align: center; font-size: 1rem; color: var(--muted); }
.a11y-dialog .day-gate .hil-list { margin: 8px 0 0; padding: 0; }

.a11y-dialog .day-gate .day-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.day-foot img {
  padding: 4px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: #ffffff;
}

.a11y-dialog .day-share { margin: 14px 0 4px; }
.a11y-dialog .day-dialog h3,
.day-dialog .set-part-title { margin: 14px 0 8px; }
.a11y-dialog.day-dialog .need-list { padding: 0; }

/* ---------- the window of a picture ---------- */

/* three rows: the name, the picture with the choices, the buttons. Only the middle one scrolls */
.a11y-dialog.studio {
  width: min(900px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 24px));
  height: min(760px, calc(100dvh - 24px));
  max-height: none;
  padding: 0;
  border: 1.5px solid var(--gold);
  border-radius: 22px;
  overflow: hidden;
}

.a11y-dialog.studio[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.studio-head {
  position: relative;
  padding: 12px 60px;
  border-bottom: 1.5px solid var(--gold);
  background: linear-gradient(var(--gold-soft), var(--gold-soft)), var(--card);
  text-align: center;
}

.a11y-dialog .studio-head h2 { margin: 0; line-height: 1.3; font-size: 1.375rem; }
.studio-x { top: 50%; transform: translateY(-50%); }

.studio-inside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.studio-view {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 18px;
  background: var(--track);
  overflow: hidden;
}

.studio-view[aria-busy="true"] .studio-image { opacity: 0.55; }

.studio-image {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  transition: opacity 0.15s ease;
}

.studio-side {
  min-height: 0;
  padding: 14px 20px;
  overflow-y: auto;
}

.studio-set {
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.studio-set legend,
.studio-label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.studio-set .name-input { width: 100%; }
.a11y-dialog .studio-set .name-note { margin: 6px 0 0; font-size: 0.9375rem; line-height: 1.5; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip { position: relative; display: inline-flex; }

/* the button itself is the whole chip; what is seen is the span beside it */
.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 1.0625rem;
  line-height: 1.2;
}

.chip input:checked + .chip-text { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); font-weight: 700; }
.chip input:focus-visible + .chip-text { outline: 3px solid var(--accent); outline-offset: 3px; }
html.a11y-contrast .chip input:focus-visible + .chip-text { outline-color: #000000; }

/* a small picture of each style */
[class*="chip-style-"] .chip-text::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid #8a7a5c;
  border-radius: 50%;
}

.chip-style-classic .chip-text::before { background: #f7f3ea; }
.chip-style-night .chip-text::before { background: linear-gradient(#0d1733, #31487c); border-color: #b99a58; }
.chip-style-stone .chip-text::before { background: linear-gradient(120deg, #e3cda4, #c09a5c); border-color: #a5824b; }
.chip-style-tchelet .chip-text::before { background: linear-gradient(#2a6da5 0 30%, #ffffff 30% 70%, #2a6da5 70%); border-color: #6fb1e0; }
.chip-style-klaf .chip-text::before { background: linear-gradient(#8a5a2b 0 18%, #f3dfb2 18% 82%, #8a5a2b 82%); border-color: #8c6434; }

/* a mark, so that what is on is not told by the colour alone */
[class*="chip-show-"] .chip-text::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

[class*="chip-show-"] input:checked + .chip-text::before {
  width: 10px;
  height: 17px;
  margin: -5px 4px 0;
  border-width: 0 3px 3px 0;
  border-radius: 0;
  transform: rotate(45deg);
}

.studio-actions {
  padding: 10px 16px 8px;
  border-top: 1px solid var(--line);
  background: var(--card);
  text-align: center;
}

.a11y-dialog .studio-status { margin: 0 0 8px; font-size: 1rem; line-height: 1.4; color: var(--muted); }
.a11y-dialog .studio-status:empty { display: none; }
.a11y-dialog .studio-status.is-error { color: var(--error-ink); }

.studio-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
}

.a11y-dialog .studio-buttons .btn { flex: 1 1 7rem; width: auto; max-width: 260px; margin: 0; padding-inline: 8px; }
.studio-buttons .btn-primary { background: var(--accent-dark); border-color: var(--accent-dark); }
.studio-link { min-height: 44px; }
.studio-link:disabled { opacity: 0.45; cursor: not-allowed; }

/* phones: the picture above the choices. It stays in place while the choices scroll under it */
@media (max-width: 700px) {
  .a11y-dialog.studio {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
  }

  .studio-inside { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 50%) minmax(0, 1fr); }
  .studio-view { order: 0; padding: 10px; }
  .studio-side { padding: 10px 14px; }
  .studio-set { margin-bottom: 10px; }
  .studio-set legend,
  .studio-label { margin-bottom: 4px; }
  .chips { gap: 6px; }
  .chip-text { gap: 6px; padding: 4px 11px; font-size: 1rem; }
}

/* a low screen, or large text on a small one: everything scrolls together, and nothing is squeezed */
@media (max-height: 560px) {
  .a11y-dialog.studio[open] { display: block; overflow-y: auto; }
  .studio-inside { display: block; overflow: visible; }
  .studio-view { height: 70vh; }
  .studio-side { overflow: visible; }
}

@media (max-width: 700px) {
  html.a11y-text-2 .a11y-dialog.studio[open],
  html.a11y-text-3 .a11y-dialog.studio[open] { display: block; overflow-y: auto; }
  html.a11y-text-2 .studio-inside,
  html.a11y-text-3 .studio-inside { display: block; overflow: visible; }
  html.a11y-text-2 .studio-view,
  html.a11y-text-3 .studio-view { height: 52vh; }
  html.a11y-text-2 .studio-side,
  html.a11y-text-3 .studio-side { overflow: visible; }
}

/* ---------- card ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 6vw, 40px);
}

/* the arrows to the next and the previous verse, beside the reference */
.verse-card { position: relative; }

.verse-step {
  position: absolute;
  top: clamp(14px, 4vw, 28px);
}

.verse-prev { inset-inline-start: clamp(14px, 4vw, 32px); }
.verse-next { inset-inline-end: clamp(14px, 4vw, 32px); }

.verse-card .ref {
  min-height: 2.5rem;
  margin-inline: 3rem;
}

.verse-card .ref:empty {
  display: block;
}

.verse-card .ref:empty::after { display: none; }

.verse-box {
  text-align: center;
  transition: opacity 0.2s ease;
}

.verse-box.is-loading { opacity: 0.45; }

.ref {
  margin: 0 0 14px;
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.ref:empty { display: none; }

.ref::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.45;
}

.verse {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-line;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.verse.is-placeholder {
  color: var(--muted);
  font-size: 1.25rem;
}

.translation {
  margin: 18px 0 0;
  font-family: var(--latin);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-line;
  overflow-wrap: break-word;
}

.error {
  margin: 20px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--error-line);
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--error-ink);
  font-size: 1.125rem;
  text-align: center;
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  flex: 1 1 140px;
  max-width: 240px;
  min-height: 48px;
  padding: 10px 24px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  font: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-dark);
}

.btn-small {
  flex: none;
  min-height: 44px;
  padding: 8px 20px;
  font-size: 1.0625rem;
}

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* arrows are drawn and not typed: the characters ‹ › are turned around by the browser inside Hebrew text */
.chev {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-arrow .chev,
.sponsor-link .chev { width: 1.05rem; height: 1.05rem; }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font: inherit;
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
  .btn-secondary:hover:not(:disabled),
  .icon-btn:hover:not(:disabled),
  .cv-comm:hover:not(:disabled) { background: var(--accent-soft); }
  .random-row .link-btn:hover:not(:disabled) { color: var(--accent-dark); }
  .place-select:hover { color: var(--accent-dark); }
  .toc-row:hover:not(:disabled),
  .need:hover { background: var(--accent-soft); }
  .gate:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
  .gate:hover:not(:disabled)::before { opacity: 0.7; border-color: var(--gold); }
  .news-pill:hover,
  .news-x:hover { border-color: var(--accent-dark); background: var(--accent-soft); }
  .luach-day:hover { border-color: var(--accent); }
  .toc-row:hover:not(:disabled) .toc-dots { opacity: 1; }
  .home-link:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
}

.btn:active:not(:disabled),
.gate:active:not(:disabled),
.icon-btn:active:not(:disabled) { transform: translateY(1px); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

html.a11y-contrast :focus-visible { outline-color: #000000; }

.btn:disabled,
.icon-btn:disabled,
.chapter-select:disabled,
.cv-comm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.links .link-btn {
  min-height: 40px;
  padding: 6px 4px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 18px;
}

/* ---------- commentary (shared) ---------- */

.commentary {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.commentary h2 {
  margin: 0;
  font-size: 1.3125rem;
  color: var(--accent-dark);
  text-align: center;
}

.commentary-status {
  margin: 12px 0 0;
  font-size: 1.125rem;
  color: var(--muted);
  text-align: center;
}

.commentary-status.is-error { color: var(--error-ink); }

.commentary-status:empty { display: none; }

.commentator { margin-top: 22px; }

.commentator h3 {
  margin: 0 0 6px;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--accent);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink);
}

.commentator p {
  margin: 0 0 10px;
  font-size: 1.125rem;
  line-height: 1.75;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.commentator strong { color: var(--accent-dark); }

/* ---------- chapter view ---------- */

.chapter-title {
  margin: 0;
  text-align: center;
  font-size: 1.6875rem;
  color: var(--accent-dark);
}

.chapter-meta {
  margin: 2px 0 0;
  text-align: center;
  text-wrap: balance;
  font-size: 1rem;
  color: var(--muted);
}

.chapter-meta:empty { display: none; }

.chapter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chapter-name {
  flex: 1;
  min-width: 0;
}

.select-wrap {
  position: relative;
  min-width: 0;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 18px;
  width: 8px;
  height: 8px;
  border: solid var(--accent-dark);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.chapter-select {
  width: 100%;
  min-height: 48px;
  padding: 6px 18px;
  padding-inline-end: 40px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-dark);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.chapter-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 1.0625rem;
  color: var(--muted);
  cursor: pointer;
}

.toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.chapter-verses {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  transition: opacity 0.2s ease;
}

.chapter-verses[aria-busy="true"] { opacity: 0.45; }

.cv {
  margin: 0 -12px 2px;
  padding: 6px 12px;
  border-radius: 12px;
  transition: background-color 0.3s ease;
  scroll-margin-top: 90px;
}

.cv.is-current { background: var(--accent-soft); }

.cv-text {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

.cv-num {
  margin-inline-end: 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.cv-comm {
  position: relative;
  margin-inline-start: 6px;
  padding: 1px 11px 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cv-comm::after {
  content: "";
  position: absolute;
  inset: -9px -4px;
}

.cv-comm[aria-expanded="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cv-en {
  display: none;
  margin: 0 0 4px;
  font-family: var(--latin);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
  text-align: left;
  overflow-wrap: break-word;
}

.show-en .cv-en { display: block; }

.cv-panel {
  margin: 6px 0 12px;
  padding: 2px 14px 4px;
  border-inline-start: 2px solid var(--accent);
}

.cv-panel .commentary-status {
  margin: 8px 0;
  text-align: start;
  font-size: 1.0625rem;
}

.cv-panel .commentator { margin-top: 12px; }
.cv-panel .commentator h3 { font-size: 1.125rem; }
.cv-panel .commentator p { font-size: 1.0625rem; }

.chapter-foot {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* short description of the site, closed at the bottom of the opening screen */
.about {
  max-width: 34rem;
  margin: 26px auto 0;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}

.about summary {
  display: inline-block;
  padding: 8px;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}

.about summary::-webkit-details-marker { display: none; }

.about p { margin: 0 0 6px; }

/* a small thank-you at the very end, seen only by whoever opens "על האתר" */
.about .about-thanks {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--light-blue);
}

.foot-name {
  flex-basis: 100%;
  font-family: var(--latin);
  font-size: 0.875rem;
}

.not-found { text-align: center; }

.not-found .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  text-decoration: none;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 22px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-foot a,
.site-foot .link-btn {
  color: var(--accent-dark);
  font-size: inherit;
  text-underline-offset: 3px;
}

/* ---------- dedication & sponsor (content comes from data/sponsors.js) ---------- */
/* right under the site name */
.dedication {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.sponsor {
  margin-top: 18px;
  padding: 14px 18px 16px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card);
}

.sponsor-label {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sponsor-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sponsor-image {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-soft);
}

.sponsor-text { min-width: 0; }

.sponsor-name {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sponsor-desc {
  margin: 2px 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.sponsor-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  margin-top: 12px;
  text-decoration: none;
}

.sponsor-cta { font-weight: 700; }

/* ---------- accessibility menu ---------- */

.a11y-fab {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  inset-inline-end: max(16px, env(safe-area-inset-left));
  z-index: 60;
  display: block;
  width: var(--fab-size);
  height: var(--fab-size);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: var(--a11y-blue);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* the owner's round button image (img/a11y-button.webp); its gold rim is part of the picture */
.a11y-fab .a11y-icon {
  display: block;
  width: 100%;
  height: 100%;
}

@media (hover: hover) {
  .a11y-fab:hover { transform: scale(1.06); }
}

.a11y-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.a11y-panel {
  position: fixed;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--fab-size) + 12px);
  inset-inline-end: 16px;
  z-index: 60;
  width: min(350px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
  font-family: var(--serif);
}

.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.a11y-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.a11y-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.a11y-size {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-weight: 700;
}

.a11y-size-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.a11y-step {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.a11y-step:disabled { opacity: 0.4; cursor: not-allowed; }

.a11y-size output {
  min-width: 3.2em;
  text-align: center;
  direction: ltr;
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.a11y-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 74px;
  padding: 10px 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.a11y-opt svg { width: 26px; height: 26px; flex: none; }

.a11y-opt[aria-pressed="true"] {
  border-color: var(--a11y-blue);
  background: #e8efff;
  color: #0b2a78;
}

html.a11y-dark .a11y-opt[aria-pressed="true"] {
  background: #1e2a4a;
  color: #dbe5ff;
  border-color: #8fb0ff;
}

.a11y-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
}

.a11y-reset {
  min-height: 40px;
  padding: 6px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

/* shared by both dialogs: the accessibility statement and the privacy policy */
.a11y-dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 24px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

.a11y-dialog::backdrop { background: rgba(20, 16, 10, 0.55); }

.a11y-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--accent-dark);
}

.a11y-dialog h3 {
  margin: 16px 0 6px;
  font-size: 1.1875rem;
}

.a11y-dialog p,
.a11y-dialog li {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.a11y-dialog p { margin: 0 0 10px; }

.a11y-dialog ul {
  margin: 0 0 10px;
  padding-inline-start: 1.3em;
}

.a11y-dialog .mail {
  color: var(--accent-dark);
  font-weight: 700;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.a11y-dialog .btn {
  width: 100%;
  max-width: none;
  margin-top: 10px;
}

/* ---------- privacy notice ("cookie banner") ---------- */

/* Sits just above the accessibility button, so that button stays visible and usable.
   Below the accessibility menu (z-index 60), which opens over it. */
.consent {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--fab-size) + 12px);
  z-index: 55;
  max-width: 640px;
  max-height: calc(100vh - var(--fab-size) - 56px);
  max-height: calc(100dvh - var(--fab-size) - 56px);
  margin-inline: auto;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid var(--card-line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}

.consent-title {
  margin: 0 0 4px;
  font-size: 1.125rem;
  color: var(--accent-dark);
}

.consent-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

html.a11y-spacing .consent-text {
  line-height: 2.2;
  letter-spacing: 0.06em;
  word-spacing: 0.16em;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
}

/* 19px bold counts as large text, so white on --accent passes WCAG AA (at 17px it does not) */
.consent .btn { font-size: 1.1875rem; }

[hidden] { display: none !important; }

/* phones: the accessibility button is smaller and sits in the top corner, beside the site name.
   At the bottom it covered one of the gates. There it covers nothing on the opening screen, on any phone. */
@media (max-width: 600px), (max-height: 480px) {
  :root { --fab-size: 58px; }

  body { padding-bottom: max(calc(36px + var(--consent-h, 0px)), env(safe-area-inset-bottom)); }

  .site-head h1 { padding-inline: 56px; }

  .a11y-fab {
    top: max(8px, env(safe-area-inset-top));
    bottom: auto;
    inset-inline-end: max(10px, env(safe-area-inset-left));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .a11y-panel {
    top: calc(max(8px, env(safe-area-inset-top)) + var(--fab-size) + 8px);
    bottom: auto;
    inset-inline-end: 10px;
    max-height: calc(100vh - var(--fab-size) - 40px);
    max-height: calc(100dvh - var(--fab-size) - 40px);
  }

  .consent { bottom: max(16px, env(safe-area-inset-bottom)); }
  .toast { bottom: max(24px, env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .site-head h1 { font-size: 1.625rem; }
  .verse { font-size: 1.5rem; }
  .btn { padding-inline: 16px; }
  .chapter-title { font-size: 1.5rem; }
  .cv-text { font-size: 1.3125rem; }
  .ask-title { font-size: 1.625rem; }
  .picker { padding-inline: 12px; }
  .wrap:not(.is-home) .chapter-select { font-size: 1rem; }
  .picker-cols { column-gap: 10px; }
  .chapter-select { padding-inline: 8px 30px; }
  .select-wrap::after { inset-inline-end: 14px; }
  .consent { padding: 12px 14px; }
  .consent-text { line-height: 1.5; }
  .consent-actions { gap: 8px 10px; margin-top: 8px; }
  .consent .btn { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
