@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSans-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSans-Italic-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSerif-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Serif";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSerif-Italic-Variable.woff2") format("woff2");
}

/* Hebrew faces complement the existing Latin/Greek Noto fonts. */
@font-face {
  font-family: "Noto Serif Hebrew";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSerifHebrew-Variable.ttf") format("truetype");
}

@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSerifHebrew-Variable.ttf") format("truetype");
  unicode-range: U+0590-05FF, U+FB1D-FB4F;
}

@font-face {
  font-family: "Noto Sans Hebrew";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSansHebrew-Variable.ttf") format("truetype");
}

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/NotoSansHebrew-Variable.ttf") format("truetype");
  unicode-range: U+0590-05FF, U+FB1D-FB4F;
}

:root {
  color-scheme: light;
  --accent: #780f12;
  --accent-soft: #f6e8e8;
  --pericope-highlight: #fffee7;
  --ink: #151515;
  --muted: #696969;
  --line: #dadada;
  --active-reference-highlight: rgba(119, 199, 230, 0.28);
  --user-note-color: #16803a;
  --panel: rgba(248, 248, 248, 0.94);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
  --reader-font-size: 20px;
  --reader-font: "Noto Serif", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
}

.loading {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  color: var(--accent);
}

.loading img {
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: calc(6px + env(safe-area-inset-top)) 10px 8px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
}

/* Nel lettore la barra copre completamente il testo che le passa sotto. */
.reader-topbar {
  isolation: isolate;
  background: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.topbar-main {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.app-brand {
  min-width: 0;
  overflow: hidden;
  color: #181818;
  font-size: 17px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-row {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.home-link {
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.calendar-link {
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible,
.calendar-link:hover,
.calendar-link:focus-visible {
  background: #eeeeee;
  outline: 0;
}

.topbar-title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 650;
}

.reader-title-spacer {
  visibility: hidden;
}

.topbar-search {
  min-width: 0;
  display: block;
}

.topbar-search .search-box {
  min-height: 36px;
}

.topbar-search .search-box input {
  font-size: 16px;
}

.toolbar-side {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.toolbar-side.end {
  justify-content: flex-end;
}

.icon-btn,
.text-btn,
.chapter-btn,
.book-btn,
.result-item,
.library-item {
  -webkit-tap-highlight-color: transparent;
}

.icon-btn {
  width: 34px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:active,
.icon-btn.active {
  background: #eeeeee;
}

.icon-btn[disabled] {
  opacity: 0.36;
  cursor: default;
}

.annotation-mode-btn {
  display: inline-grid;
}

.greek-mode-btn {
  font-family: "Noto Serif", Georgia, serif;
  font-size: 25px;
  font-weight: 800;
}

.greek-mode-btn.active,
.annotation-mode-btn.active {
  color: #fff;
  background: var(--accent);
}

.reader-body.greek-mode .verse {
  cursor: pointer;
}

.reader-body.greek-mode .verse:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.greek-verse-backdrop {
  width: 100vw;
  align-items: center;
  padding: 12px;
}

.greek-verse-backdrop .popover {
  width: min(100%, 680px);
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
}

.greek-interlinear-text {
  margin: 0;
  font-family: var(--reader-font);
  font-size: var(--greek-font-size, var(--reader-font-size, 20px));
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.greek-gloss {
  color: #555;
  font-family: var(--reader-font);
  font-size: var(--reader-font-size, 20px);
}

.annotation-controls {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d5d5da;
  border-radius: 9px;
}

.annotation-controls .icon-btn {
  border-radius: 0;
}

.icon-btn[data-action="back"] {
  width: 40px;
  font-size: 30px;
  font-weight: 500;
}

.external-app-back {
  width: 36px;
  border-color: #9b2b2b;
  color: #8b2020;
  font-size: 22px;
  font-weight: 700;
}

.home-link.icon-btn {
  width: 40px;
  font-size: 30px;
  font-weight: 500;
}

.chapter-picker-btn {
  min-width: 58px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  background: #fff;
  color: #721416;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chapter-picker-btn:active {
  background: #f0f0f0;
}

.font-size-icon {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.font-size-icon span {
  font-size: 14px;
  font-weight: 700;
}

.font-size-icon strong {
  font-size: 21px;
}

.sf-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-svg {
  width: 23px;
  height: 23px;
}

.field-search-svg {
  width: 25px;
  height: 25px;
}

.xmark-svg {
  width: 21px;
  height: 21px;
  fill: rgba(0, 0, 0, 0.12);
  stroke-width: 2;
}

.search-panel,
.reader-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 16px 4px;
}

.search-box {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1.2px solid rgba(0, 0, 0, 0.32);
  border-radius: 9px;
  background: #fff;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111;
}

.search-icon {
  color: rgba(0, 0, 0, 0.76);
}

.clear-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.clear-btn[hidden] {
  display: none;
}

.mode-toggle {
  min-width: 46px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(120, 15, 18, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
}

.mode-toggle.mode-family,
.mode-toggle.mode-family-filter {
  border-color: rgba(26, 106, 52, 0.24);
  color: #1a6a34;
}

.mode-toggle.mode-advanced {
  background: #fff;
  color: var(--accent);
}

.advanced-search-mark {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
}

.advanced-search-dot,
.advanced-search-star {
  display: inline-block;
}

.advanced-search-star {
  font-size: 1.12em;
}

.content {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 0 16px 24px;
}

.testament {
  margin-top: 18px;
}

.testament h2 {
  margin: 0 0 10px;
  color: #6f7378;
  font-size: 20px;
  font-weight: 700;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 7px;
}

.book-btn,
.chapter-btn {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.book-btn {
  font-family: Verdana, Arial, sans-serif;
  font-size: 15px;
  color: var(--accent);
}

.book-btn.psalms-book {
  background: #e9f6e8;
}

.book-btn:active,
.chapter-btn:active,
.text-btn:active,
.result-item:active,
.library-item:active {
  background: #f0f0f0;
}

.reader {
  min-height: 100vh;
  min-height: 100dvh;
}

.calendar-view {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top right, rgba(120, 15, 18, 0.06), transparent 28%),
    linear-gradient(180deg, #fcfcfc 0%, #ffffff 180px);
}

.calendar-topbar {
  padding-bottom: 10px;
}

.calendar-content {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.calendar-page {
  margin-bottom: 18px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.05);
}

.calendar-page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.calendar-page-head h2 {
  margin: 0;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.15;
}

.calendar-page-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.calendar-page-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f4ea;
  color: #333;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.35;
}

.calendar-table {
  display: grid;
  gap: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.calendar-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(86px, 24%) minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.calendar-entry.from-note {
  background: #fffdf6;
}

.calendar-entry.is-sunday .calendar-left {
  background: var(--accent);
  color: #fff;
}

.calendar-entry.is-sunday .calendar-left a {
  color: #fff;
}

.calendar-cell {
  min-width: 0;
  padding: 10px 11px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.22;
  white-space: pre-wrap;
  word-break: break-word;
}

.calendar-left {
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  background: #f6f6f6;
  font-weight: 700;
}

.calendar-right {
  background: #fff;
}

.calendar-entry a[data-bible-reference] {
  color: #0b4fa2;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.calendar-supplements {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 8px 11px 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  background: #fafafa;
  color: #505050;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.25;
}

.calendar-supplement {
  margin: 0;
}

.calendar-page-notes {
  margin-top: 12px;
  padding: 10px 12px 2px;
  border-radius: 12px;
  background: #f6f6f8;
}

.calendar-page-notes h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-note-list {
  display: grid;
  gap: 6px;
}

.calendar-note {
  margin: 0;
  color: #4d4d4d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.3;
  white-space: pre-wrap;
}

.calendar-docx-content {
  width: min(100%, 980px);
  padding-top: 10px;
}

.calendar-docx-introduction {
  margin: 0 0 22px;
  padding: 18px 20px 20px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  background: #fff;
  color: #151515;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.3;
}

.calendar-docx-introduction h2 {
  margin: 0;
  text-align: center;
}

.calendar-docx-introduction h2 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.calendar-docx-introduction h2:first-child {
  margin-top: 0;
}

.calendar-introduction-paragraph {
  margin: 5px 0;
}

.calendar-introduction-paragraph.align-center {
  text-align: center;
}

.calendar-introduction-paragraph.align-right {
  text-align: right;
}

.calendar-introduction-table {
  display: grid;
  gap: 3px;
  margin: 8px 0 12px;
}

.calendar-introduction-row {
  display: grid;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr);
  gap: 10px;
}

.calendar-introduction-cell {
  min-width: 0;
}

.calendar-introduction-table.lectio-plan .calendar-introduction-row {
  grid-template-columns: minmax(210px, 42%) minmax(0, 1fr);
}

.calendar-introduction-table.lectio-plan .calendar-introduction-cell:first-child::before {
  content: "\2022";
  display: inline-block;
  width: 1em;
}

.calendar-roman-content {
  display: grid;
  gap: 22px;
  justify-items: center;
  width: 100%;
  max-width: none;
  padding: 18px 12px 42px;
  background: #ececec;
}

.calendar-roman-month {
  width: min(100%, 980px);
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.calendar-roman-month h2 {
  margin: 0;
  padding: 14px 12px 10px;
  border: 1px solid #202020;
  border-bottom: 0;
  background: #dfeaf4;
  color: #1c1c1c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.1;
  text-align: center;
}

.calendar-roman-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #202020;
  font-family: Georgia, "Times New Roman", serif;
}

.calendar-roman-table th,
.calendar-roman-table td {
  border: 1px solid #202020;
  vertical-align: top;
}

.calendar-roman-day-number {
  width: 40px;
  padding: 8px 4px;
  font-size: 22px;
  line-height: 1.1;
  text-align: center;
}

.calendar-roman-weekday {
  width: 108px;
  padding: 8px;
  font-size: 20px;
  line-height: 1.1;
  text-align: center;
  font-weight: 700;
}

.calendar-roman-content-cell {
  padding: 7px 9px 8px;
  font-size: 15px;
  line-height: 1.22;
}

.calendar-roman-content-cell p {
  margin: 0;
}

.calendar-roman-readings {
  margin-bottom: 4px;
  font-weight: 650;
}

.calendar-roman-liturgy {
  color: #222;
}

.calendar-roman-day.is-sunday .calendar-roman-day-number,
.calendar-roman-day.is-sunday .calendar-roman-weekday {
  background: #c90000;
  color: #fff;
}

.calendar-roman-day.is-saturday .calendar-roman-day-number,
.calendar-roman-day.is-saturday .calendar-roman-weekday {
  background: #ddd;
}

.calendar-roman-day.is-feast .calendar-roman-content-cell {
  background: #fff4cb;
}

.calendar-roman-day.is-today .calendar-roman-content-cell {
  background: var(--active-reference-highlight);
  box-shadow: inset 0 0 0 2px rgba(81, 174, 235, 0.55);
}

.calendar-roman-day.is-today .calendar-roman-day-number,
.calendar-roman-day.is-today .calendar-roman-weekday {
  background: var(--active-reference-highlight);
  color: #151515;
}

.calendar-roman-content a[data-bible-reference] {
  color: #003f8c;
  font-weight: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 63, 140, 0.35);
}

.calendar-roman-content a[data-bible-reference]:hover,
.calendar-roman-content a[data-bible-reference]:focus-visible {
  background: rgba(255, 244, 203, 0.9);
  outline: 1.5px solid rgba(148, 103, 0, 0.35);
}

.calendar-mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-start-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-mode-control button,
.calendar-start-control button {
  min-height: 42px;
  padding-inline: 8px;
  line-height: 1.15;
}

@media (max-width: 640px) {
  .calendar-roman-month h2 { font-size: 24px; }
  .calendar-roman-day-number { width: 34px; font-size: 18px; }
  .calendar-roman-weekday { width: 84px; font-size: 16px; padding-inline: 4px; }
  .calendar-roman-content-cell { font-size: 13px; padding: 6px; }
}

.calendar-docx-heading,
.calendar-docx-separator,
.calendar-docx-note,
.calendar-docx-day,
.calendar-docx-standalone {
  font-family: Georgia, "Times New Roman", serif;
}

.calendar-docx-heading {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-bottom: 0;
  background: #fff;
  color: #151515;
  text-align: center;
  font-size: 19px;
  line-height: 1.2;
}

.calendar-docx-separator {
  padding: 3px 10px 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #e9e9e9;
  color: #151515;
  text-align: center;
  font-size: 18px;
  line-height: 1.05;
}

.calendar-docx-note {
  margin: 0 0 12px;
  padding: 5px 8px;
  color: #151515;
  font-size: 14px;
  line-height: 1.2;
}

.calendar-docx-day,
.calendar-docx-standalone {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.34);
  border-top: 0;
  background: #fff;
  color: #151515;
}

.calendar-docx-day:first-child,
.calendar-docx-standalone:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.34);
}

.calendar-docx-day.is-today {
  position: relative;
  border-color: rgba(9, 119, 190, 0.9);
  box-shadow: inset 0 0 0 3px rgba(81, 174, 235, 0.55);
  background: var(--active-reference-highlight);
}

.calendar-docx-day.is-today .calendar-docx-day-title,
.calendar-docx-day.is-today .calendar-docx-preface,
.calendar-docx-day.is-today .calendar-docx-date {
  background: var(--active-reference-highlight);
}

.calendar-docx-day-title {
  padding: 4px 8px 3px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  background: #fffdf7;
  text-align: center;
  font-size: 19px;
  line-height: 1.08;
}

.calendar-docx-preface {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  text-align: center;
  font-size: 17px;
  line-height: 1.12;
}

.calendar-docx-date {
  padding: 4px 8px 3px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  background: #fff;
  font-size: 18px;
  line-height: 1.1;
}

.calendar-docx-rows {
  display: grid;
}

.calendar-docx-row {
  display: grid;
  grid-template-columns: minmax(104px, 18%) minmax(0, 1fr);
  min-height: 26px;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
}

.calendar-docx-row:first-child {
  border-top: 0;
}

.calendar-docx-label,
.calendar-docx-readings {
  min-width: 0;
  padding: 3px 8px;
  font-size: 17px;
  line-height: 1.14;
}

.calendar-docx-label {
  border-right: 1px solid rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}

.calendar-docx-readings {
  word-break: normal;
  overflow-wrap: anywhere;
}

.calendar-docx-content a[data-bible-reference] {
  color: #0b4fa2;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.calendar-empty {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
}

.reader-body {
  width: min(100%, 940px);
  margin: 0 auto;
  padding: 14px 14px 56px;
  font-family: var(--reader-font);
  font-size: var(--reader-font-size);
  line-height: 1.42;
  background: #fff;
  -webkit-touch-callout: none;
  -webkit-user-select: text;
  user-select: text;
}

.reader-body.annotation-mode {
  -webkit-user-select: none;
  user-select: none;
}

.reader-body.annotation-mode .verse-text {
  cursor: crosshair;
}

.annotation-selection {
  border-radius: 3px;
  background: rgba(20, 118, 150, 0.22);
}

/* La selezione con la penna deve restare riconoscibile anche sopra un passo richiamato. */
.reader-body.annotation-mode .annotation-selection {
  background: rgba(20, 118, 150, 0.22);
}

.chapter-heading {
  margin: 22px 0 8px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1em;
  font-weight: 700;
  line-height: 1.05;
}

.chapter-heading:first-child {
  margin-top: 2px;
}

.book-section-title-block {
  display: block;
}

.book-section-title {
  margin: 30px 0 8px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.15;
}

.book-section-title-block:first-child .book-section-title {
  margin-top: 2px;
}

.book-section-content {
  margin: 0 0 16px;
}

.chapter-jump {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.verse {
  display: inline;
}

.verse-number {
  color: #b54a4a;
  font-size: 0.58em;
  font-weight: 700;
  vertical-align: super;
  padding-right: 0.15em;
}

.verse-note-number {
  color: var(--user-note-color);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.active-reference .verse-note-number {
  color: var(--user-note-color);
}

.verse-note-number:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(22, 128, 58, 0.55);
  outline-offset: 2px;
}

.reader-body.annotation-mode .verse-number {
  cursor: pointer;
}

.verse mark {
  border-radius: 3px;
  background: #c9f4c7;
  color: inherit;
  padding: 0 0.08em;
}

.user-highlight {
  color: var(--user-highlight-color, #0057c9);
  font-weight: var(--user-highlight-weight, 400);
}

.user-replacement {
  color: var(--user-replacement-color, #00732f);
  font-weight: var(--user-replacement-weight, 400);
  cursor: pointer;
}

.user-note {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--user-note-color);
  text-decoration-thickness: var(--user-note-underline-width, 0.12em);
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: none;
  cursor: pointer;
}

/* When a note overlaps a highlight, keep the highlight color and add only the note underline. */
.user-note.user-highlight {
  color: var(--user-highlight-color, #0057c9);
}

.active-reference {
  cursor: copy;
}

html[data-reference-highlight-style="background"] .active-reference > .verse-number-background,
.reference-highlight-preview.background .verse-number-background {
  background: var(--reference-highlight-background, rgba(119, 199, 230, 0.18));
  border-radius: 3px;
}

.reference-hit {
  border-radius: 3px;
  background: var(--reference-highlight-background, rgba(119, 199, 230, 0.18));
  padding: 0 0.08em;
  cursor: copy;
}

html[data-reference-highlight-style="brackets"] .reference-hit,
.reference-highlight-preview.brackets .reference-hit {
  border-radius: 0;
  background: transparent;
  color: var(--reference-highlight-color, #003f8f);
  padding: 0;
  font-weight: var(--reference-highlight-weight, 500);
}

html[data-reference-highlight-style="brackets"] .reference-hit.user-highlight {
  color: var(--user-highlight-color, #0057c9);
  font-weight: var(--user-highlight-weight, 400);
}

html[data-reference-highlight-style="brackets"] .reference-hit.user-replacement {
  color: var(--user-replacement-color, #00732f);
  font-weight: var(--user-replacement-weight, 400);
}

html[data-reference-highlight-style="bracketed"] .reference-hit,
.reference-highlight-preview.bracketed .reference-hit {
  border-radius: 0;
  background: transparent;
  padding: 0;
}

html[data-reference-highlight-style="bracketed"] .reference-bracket-start::before,
html[data-reference-highlight-style="bracketed"] .reference-bracket-end::after,
.reference-highlight-preview.bracketed .reference-bracket-start::before,
.reference-highlight-preview.bracketed .reference-bracket-end::after {
  color: var(--reference-highlight-bracket-color, #ff1744);
  font-weight: 900;
}

html[data-reference-highlight-style="bracketed"] .reference-bracket-start::before,
.reference-highlight-preview.bracketed .reference-bracket-start::before {
  content: " [ ";
}

html[data-reference-highlight-style="bracketed"] .reference-bracket-end::after,
.reference-highlight-preview.bracketed .reference-bracket-end::after {
  content: " ] ";
}

.reader.reference-highlight-inverted .verse-text,
.reference-highlight-preview.brackets.inverted {
  color: var(--reference-highlight-color, #963a58);
  font-weight: var(--reference-highlight-weight, 500);
}

.reader.reference-highlight-inverted .reference-hit,
.reader.reference-highlight-inverted .reference-hit.user-highlight,
.reader.reference-highlight-inverted .reference-hit.user-replacement,
.reference-highlight-preview.brackets.inverted .reference-hit {
  color: var(--ink);
  font-weight: 400;
}

.reader.reference-highlight-inverted .reference-bracket-start::before,
.reader.reference-highlight-inverted .reference-bracket-end::after,
.reference-highlight-preview.brackets.inverted .reference-bracket-start::before,
.reference-highlight-preview.brackets.inverted .reference-bracket-end::after {
  color: var(--ink);
}

.selection-toolbar {
  position: fixed;
  z-index: 80;
  display: inline-flex;
  flex-wrap: wrap;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}

.selection-toolbar button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.selection-toolbar button:active {
  background: rgba(0, 0, 0, 0.08);
}

.verse.search-hit {
  background: transparent;
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.22);
}

.toast-popup {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translateX(-50%);
  display: grid;
  gap: 2px;
  width: min(320px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(26, 26, 26, 0.92);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  color: #fff;
  text-align: center;
}

.toast-popup strong {
  font-size: 15px;
  line-height: 1.2;
}

.toast-popup span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-notice,
.update-activity {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 95;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}

.update-status,
.update-note {
  display: block;
}

.update-note {
  margin-top: 5px;
  max-width: 480px;
  font-weight: 400;
  line-height: 1.4;
}

.update-notice button {
  flex-shrink: 0;
  min-height: 34px;
  padding: 6px 11px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.update-activity {
  display: block;
  pointer-events: none;
}

.sheet,
.popover {
  width: min(100%, 720px);
  max-height: min(82vh, 720px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.popover {
  width: min(92vw, 300px);
  max-height: calc(100vh - 74px);
  max-height: calc(100dvh - 74px - env(safe-area-inset-bottom));
  margin: 58px 10px auto auto;
  border-radius: 14px;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: 17px;
}

.library-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.library-head h2 {
  flex: none;
  text-align: center;
}

.plain-head-btn {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.plain-head-btn:first-child {
  justify-self: start;
}

.plain-head-btn:last-child {
  justify-self: end;
}

.plain-head-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.sheet-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
}

.sheet-body:focus {
  outline: 0;
}

.user-decoration-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: transparent;
}

.user-decoration-popover {
  position: fixed;
  left: var(--decoration-popover-left, 12px);
  top: var(--decoration-popover-top, 64px);
  width: var(--decoration-popover-width, min(360px, calc(100vw - 24px)));
  max-height: min(52vh, 420px);
  overflow: auto;
  padding: 14px 16px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}

.user-decoration-popover:focus {
  outline: 0;
}

.note-editor-shell {
  display: grid;
  gap: 12px;
}

.replacement-editor-shell {
  display: grid;
  gap: 12px;
}

.replacement-original-highlight {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff0a6;
  color: #111;
  box-shadow: inset 0 0 0 1px rgba(120, 15, 18, 0.14);
}

.replacement-original-highlight span,
.replacement-editor-label {
  color: #111;
  font-size: 13px;
  font-weight: 750;
}

.replacement-original-highlight strong {
  color: #111;
  font-size: 17px;
  line-height: 1.35;
}

.replacement-editor-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
}

.replacement-editor-input:focus {
  border-color: rgba(120, 15, 18, 0.42);
  box-shadow: 0 0 0 3px rgba(120, 15, 18, 0.08);
  outline: none;
}

.decoration-preview-shell {
  display: grid;
  gap: 12px;
}

.decoration-preview-item {
  display: grid;
  gap: 0;
}

.decoration-preview-item + .decoration-preview-item {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.decoration-preview-item h3 {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  line-height: 1.25;
}

.decoration-note,
.decoration-replacement {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

.decoration-empty {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.decoration-note p,
.decoration-note ul,
.decoration-note ol,
.decoration-note blockquote,
.decoration-note pre {
  margin: 0 0 10px;
}

.decoration-note :last-child {
  margin-bottom: 0;
}

.decoration-note .note-reference-symbol,
.help-text .note-reference-symbol {
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.3em;
  font-weight: 700;
  line-height: 0.865;
  vertical-align: -0.04em;
}

.user-report-metadata {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.decoration-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.decoration-preview-actions .text-btn {
  min-height: 42px;
  font-weight: 700;
}

.note-editor-reference {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.note-editor-selection {
  max-height: 84px;
  margin: 0;
  overflow: auto;
  padding: 10px 12px;
  border-left: 3px solid rgba(120, 15, 18, 0.28);
  background: #f7f7f9;
  color: #303030;
  font-size: 14px;
  line-height: 1.35;
}

.note-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: #eeeeee;
}

.note-format-toolbar button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.note-format-toolbar button:active {
  background: #dedee2;
}

.note-format-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-format-icon text {
  fill: currentColor;
  stroke: none;
  font-family: system-ui, sans-serif;
  font-size: 6px;
  font-weight: 750;
}

.note-rich-editor {
  min-height: 220px;
  max-height: min(42vh, 420px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  outline: none;
  overscroll-behavior: contain;
  -webkit-user-select: text;
  user-select: text;
}

.note-rich-editor:focus {
  border-color: rgba(120, 15, 18, 0.42);
  box-shadow: 0 0 0 3px rgba(120, 15, 18, 0.08);
}

.note-rich-editor a,
.user-report-note a,
.decoration-note a {
  color: #0b63b6;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.user-report-note sup,
.decoration-note sup {
  font-size: 0.6em;
  line-height: 0;
  vertical-align: super;
}

.note-rich-editor p,
.note-rich-editor blockquote,
.note-rich-editor ul,
.note-rich-editor ol,
.note-rich-editor pre {
  margin: 0 0 10px;
}

.note-rich-editor blockquote {
  padding-left: 12px;
  border-left: 3px solid rgba(120, 15, 18, 0.28);
  color: #555;
}

.note-rich-editor code,
.note-rich-editor pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.note-rich-editor pre {
  padding: 10px;
  border-radius: 8px;
  background: #f4f4f8;
  white-space: pre-wrap;
}

.note-editor-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

.note-editor-actions .text-btn {
  min-height: 42px;
  font-weight: 700;
}

.settings-backdrop {
  align-items: start;
  background: rgba(0, 0, 0, 0.12);
}

.settings-sheet {
  max-height: min(92vh, 920px);
  border-radius: 30px 30px 0 0;
  background: #f4f4f8;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.14);
}

.settings-head {
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px 28px 12px;
}

.settings-head h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 760;
}

.settings-done {
  justify-self: end;
  min-height: 54px;
  padding: 0 25px;
  border: 0;
  border-radius: 28px;
  background: #fff;
  color: #111;
  font-size: 24px;
  font-weight: 760;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.10);
  cursor: pointer;
}

.settings-body {
  padding: 12px 24px 34px;
}

.settings-group-title {
  margin: 20px 0 12px;
  color: #8f8f98;
  font-size: 24px;
  font-weight: 760;
}

.settings-card {
  padding: 18px 22px;
  border-radius: 28px;
  background: #fff;
}

.settings-card + .settings-card {
  margin-top: 12px;
}

.font-settings-head {
  margin-bottom: 18px;
}

.font-settings-head h4 {
  margin: 0;
  color: #050505;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
}

.font-settings-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.ios-slider-box {
  padding: 0;
  border: 1.6px solid #bdbdc1;
  border-radius: 19px;
  padding: 18px 18px 20px;
}

.ios-slider-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.ios-slider-label label {
  flex: 1;
  color: #050505;
  font-size: 24px;
  line-height: 1.15;
}

.ios-slider-label output {
  color: #8c8c92;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.ios-slider-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}

.ios-slider-controls input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #9f2d31;
}

.slider-stepper {
  width: 44px;
  height: 44px;
  border: 1px solid #bdbdc1;
  border-radius: 12px;
  background: #fff;
  color: #9f2d31;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.slider-stepper:active {
  background: #f4eeee;
}

.screen-preview {
  color: #050505;
  line-height: 1.2;
}

.font-family-previews {
  display: grid;
  gap: 18px;
}

.screen-preview-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.screen-preview-row .screen-preview {
  flex: 1 1 auto;
  min-width: 0;
}

.screen-preview-verse {
  color: #b54a4a;
  font-size: 0.58em;
  vertical-align: super;
  padding-right: 0.15em;
}

.ios-divider {
  height: 1px;
  margin: 18px 0;
  background: #dedee2;
}

.decoration-style-divider {
  margin-bottom: 14px;
}

.decoration-style-stack {
  display: grid;
  gap: 18px;
}

.decoration-style-section {
  display: grid;
  gap: 10px;
}

.decoration-style-section + .decoration-style-section {
  padding-top: 16px;
  border-top: 1px solid #dedee2;
}

.decoration-style-section h4,
.decoration-style-property {
  margin: 0;
  color: #050505;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.1;
}

.decoration-style-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.weight-slider-control {
  display: grid;
  grid-template-columns: 30px minmax(28px, 1fr) 30px 28px;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.weight-slider-control input[type="range"] {
  width: 100%;
  min-width: 0;
  margin: 0;
  accent-color: #9f2d31;
}

.weight-slider-control output {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.decoration-stepper {
  width: 30px;
  height: 34px;
  padding: 0;
  border: 1px solid #c9c9cf;
  border-radius: 8px;
  background: #fff;
  color: #9f2d31;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.decoration-stepper:active {
  background: #f4eeee;
}

.decoration-stepper:disabled {
  opacity: 0.32;
  cursor: default;
}

.decoration-style-reset {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
}

.settings-local-reset {
  display: block;
  margin: 16px auto 0;
}

@media (max-width: 500px) {
  .decoration-style-stack {
    gap: 16px;
  }

  .decoration-style-section h4,
  .decoration-style-property {
    font-size: 17px;
  }

  .decoration-style-row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
  }

  .decoration-stepper {
    width: 28px;
    height: 32px;
  }

  .weight-slider-control {
    grid-template-columns: 28px minmax(20px, 1fr) 28px 26px;
    gap: 3px;
  }

  .weight-slider-control output {
    font-size: 12px;
  }
}

.sample-highlight {
  color: var(--user-highlight-color, #0057c9);
  font-weight: var(--user-highlight-weight, 400);
}

.sample-replacement {
  color: var(--user-replacement-color, #00732f);
  font-weight: var(--user-replacement-weight, 400);
}

.settings-card .segmented-control {
  margin: 0;
}

.reference-highlight-settings {
  display: grid;
  gap: 9px;
}

.segmented-control.reference-highlight-style-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reference-highlight-palette {
  display: grid;
  gap: 6px;
}

.reference-highlight-palette > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.reference-highlight-label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.reference-highlight-preview {
  color: var(--ink);
  font-size: 0.94em;
  line-height: 1.5;
}

.reference-highlight-invert {
  color: #050505;
}

.reference-highlight-invert input:disabled {
  opacity: 0.35;
}

.reference-highlight-invert.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.reference-highlight-emphasis {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.reference-highlight-emphasis.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.settings-select-row,
.settings-toggle-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #050505;
  font-size: 24px;
}

.settings-select-row + .settings-select-row,
.settings-toggle-row {
  border-top: 1px solid #dedee2;
}

.settings-select-row span,
.settings-toggle-row span {
  flex: 1;
}

.settings-toggle-row.settings-toggle-compact span {
  flex: 0 1 auto;
}

.settings-select-row select {
  max-width: 58%;
  border: 0;
  background: transparent;
  color: #9f2d31;
  font-size: 22px;
  text-align: right;
}

.settings-toggle-row input {
  width: 54px;
  height: 32px;
  accent-color: #34c759;
}

.settings-flag-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #050505;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
}

.settings-flag-row span {
  min-width: 0;
}

.settings-flag-row input[type="checkbox"] {
  width: 54px;
  height: 32px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #34c759;
}

.search-settings-card {
  padding: 20px;
}

.user-data-card {
  display: grid;
  gap: 14px;
}

.user-data-identity-filter {
  display: grid;
  gap: 14px;
}

.user-id-summary {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #050505;
  font: inherit;
  text-align: right;
}

.user-id-divider {
  margin: 0;
}

.user-id-summary strong {
  min-width: 0;
  max-width: 100%;
  color: #9f2d31;
  font-size: 16px;
  overflow-wrap: anywhere;
  text-align: right;
}

.user-id-dialog-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.34);
}

.user-id-dialog {
  width: min(420px, 100%);
  box-sizing: border-box;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.user-id-dialog h3,
.user-id-dialog p {
  margin: 0;
}

.user-id-dialog p {
  color: #5f5f66;
  font-size: 16px;
  line-height: 1.4;
}

.user-id-form {
  display: grid;
  gap: 10px;
}

.user-id-form label {
  color: #5f5f66;
  font-size: 16px;
}

.user-id-form input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #c8c8ce;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: #050505;
  font: inherit;
}

.user-id-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.user-data-filter-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
  gap: 14px;
}

.user-data-filter-group {
  min-width: 0;
  margin: 0;
  border: 1px solid #dedee2;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.user-data-filter-group summary {
  min-height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #050505;
  cursor: pointer;
  list-style: none;
}

.user-data-filter-group summary::-webkit-details-marker {
  display: none;
}

.user-data-filter-group summary::after {
  content: "⌄";
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-2px);
}

.user-data-filter-group[open] summary::after {
  content: "⌃";
  transform: translateY(2px);
}

.user-data-filter-group summary span {
  font-weight: 700;
}

.user-data-filter-group summary strong {
  margin-left: auto;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.user-data-filter-menu {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px solid #ececef;
}

.user-data-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.user-data-filter-actions button {
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid rgba(159, 45, 49, 0.38);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.user-data-filter-actions button:active {
  background: #f8eeee;
}

.user-data-filter-list {
  max-height: 210px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.user-data-filter-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.user-data-filter-list input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

@media (max-width: 720px) {
  .user-data-filter-options {
    grid-template-columns: 1fr;
  }
}

.sync-card {
  display: grid;
  gap: 14px;
}

.sync-status-grid {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 8px 14px;
  color: #5f5f66;
  font-size: 16px;
  line-height: 1.3;
}

.sync-status-grid strong {
  min-width: 0;
  color: #050505;
  font-weight: 720;
}

.sync-error {
  color: #9f2d31;
}

.settings-note {
  margin: 0;
  color: #5f5f66;
  font-size: 16px;
  line-height: 1.35;
}

.user-data-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.user-data-actions .text-btn {
  min-height: 44px;
  font-weight: 700;
}

.user-report-shell {
  display: grid;
  gap: 16px;
}

.user-report-backdrop {
  align-items: start;
  background: #fff;
}

.user-report-sheet {
  max-height: 100vh;
  max-height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

.user-report-head {
  justify-content: space-between;
}

.user-report-ordering {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333338;
  font-size: 15px;
  font-weight: 700;
}

.user-report-sort-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #eeeeee;
}

.user-report-sort-control button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #333338;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.user-report-sort-control button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.user-report-tools {
  display: grid;
  gap: 12px;
}

.user-report-mode-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 10px;
  background: #eeeeee;
}

.user-report-mode-row button {
  min-height: 36px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #171717;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.user-report-mode-row button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.user-report-mode-row span {
  color: #77777d;
  font-variant-numeric: tabular-nums;
}

.user-report-origin-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #333338;
  font-weight: 700;
}

.user-report-origin-filter select {
  min-width: 0;
  max-width: 70%;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-align: right;
}

.user-report-print-area {
  display: grid;
  gap: 14px;
}

.user-report-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.user-report-title h3 {
  margin: 0 0 4px;
  color: #111;
  font-size: 22px;
}

.user-report-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.user-report-list {
  display: grid;
  gap: 12px;
}

.user-report-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-report-row h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.user-report-row h4 a {
  color: var(--accent);
  text-decoration: none;
}

.user-report-verse {
  margin: 0 0 12px;
  color: #1d1d1f;
  font-size: 16px;
  line-height: 1.45;
}

.user-report-verse sup {
  color: #a81414;
  font-size: 0.72em;
  padding-right: 0.18em;
}

.user-report-note-selection {
  background: #fff0a6;
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.user-report-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ececef;
}

.user-report-section h5 {
  margin: 0 0 8px;
  color: #6b1a1d;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.user-report-detail {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-right: 82px;
  padding-left: 10px;
  border-left: 3px solid #d8d8dd;
}

.user-report-item-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 6px;
}

.user-report-item-actions button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid #cfcfd4;
  border-radius: 9px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}

.user-report-item-actions button.danger {
  color: #c52821;
}

.user-report-item-actions .sf-icon {
  width: 20px;
  height: 20px;
}

.user-report-detail p,
.user-report-note p {
  margin: 0;
}

.user-report-selection {
  color: #333338;
  font-style: italic;
}

.user-report-note {
  color: #171717;
  line-height: 1.4;
}

.user-report-label {
  color: #67676f;
  font-weight: 750;
}

.user-report-metadata {
  color: #74747c;
}

.settings-reset {
  width: 100%;
  min-height: 48px;
  margin-top: 36px;
  padding: 0 24px;
  border: 1px solid rgba(180, 42, 35, 0.34);
  border-radius: 10px;
  background: #fff;
  color: #ff3b30;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.settings-reset:active {
  background: #fff1f0;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.chapter-btn {
  min-height: 46px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.text-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.text-btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.text-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}

.text-btn.danger {
  width: 100%;
  border-color: rgba(120, 15, 18, 0.24);
  color: var(--accent);
}

.reset-link {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.font-size-panel {
  display: grid;
  gap: 10px;
  width: 220px;
}

.font-size-title {
  font-weight: 700;
}

.font-size-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-size-controls output {
  min-width: 52px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.control-row.stacked {
  display: grid;
  align-items: stretch;
}

.control-row label {
  flex: 1;
  color: var(--muted);
}

.control-row output {
  min-width: 54px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.control-row select {
  width: min(52%, 260px);
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.settings-section {
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}

.settings-section + .settings-section {
  padding-top: 14px;
}

.settings-section h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 750;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #eeeeee;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}

.segmented-control.copy-format-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.copy-format-control button {
  min-width: 0;
  padding: 4px 2px;
  font-size: clamp(12px, 3.4vw, 14px);
  white-space: nowrap;
}

.segmented-control button.active {
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.slider-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-label label {
  flex: 1;
}

.control-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.copy-preview {
  min-height: 36px;
  color: var(--muted);
}

.checkbox-row {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-actions {
  padding-top: 14px;
}

.import-preview-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.import-preview-counts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.import-preview-counts dt,
.import-preview-counts dd {
  margin: 0;
}

.import-preview-counts dd {
  color: var(--accent);
  font-weight: 750;
}

.import-overwrite-section h4 {
  margin: 0 0 10px;
}

.import-overwrite-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-overwrite-list li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e0b9b9;
  border-radius: 9px;
  background: #fff8f8;
}

.import-overwrite-list span {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.import-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-mode-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.search-mode-row button:not(.mode-toggle) {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}

.search-mode-row button.active:not(.mode-toggle) {
  border-color: rgba(120, 15, 18, 0.3);
  background: var(--accent-soft);
  color: var(--accent);
}

.search-mode-description {
  margin-top: 12px;
}

.result-item,
.library-item {
  width: 100%;
  display: block;
  margin: 0 0 9px;
  padding: 11px 12px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.root-family-filter-row {
  margin-top: 16px;
}

.settings-toggle-row input:disabled {
  opacity: 0.35;
}

.root-filter-list {
  display: grid;
  gap: 14px;
}

.root-filter-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  background: #fff;
}

.root-filter-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.root-filter-head h3 {
  flex: 1;
  margin: 0;
  font-size: 16px;
}

.root-filter-actions {
  display: flex;
  gap: 6px;
}

.root-filter-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 650;
}

.root-filter-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 8px;
}

.root-filter-term {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f7f7f9;
  font-size: 15px;
}

.root-filter-term span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.root-filter-term input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.root-filter-footer {
  position: sticky;
  bottom: -14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px -14px -14px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 9px;
}

.library-row .library-item {
  margin: 0;
}

.library-bookmark-btn {
  width: 42px;
  min-height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 15, 18, 0.24);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
}

.library-bookmark-btn:active,
.library-bookmark-btn.active {
  border-color: rgba(120, 15, 18, 0.48);
  background: #fff;
}

.library-bookmark-btn .sf-icon {
  width: 20px;
  height: 20px;
}

.library-bookmark-btn.active .sf-icon {
  fill: var(--accent);
  stroke: var(--accent);
}

.item-title {
  color: var(--accent);
  font-weight: 750;
}

.item-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.result-item mark {
  border-radius: 3px;
  background: #ffec99;
  color: inherit;
  padding: 0 0.08em;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 9px;
  background: #eeeeee;
}

.tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}

.tabs button.active {
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.empty,
.error {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
}

.help-text {
  color: #303030;
  line-height: 1.45;
}

.help-section {
  margin-bottom: 18px;
}

.help-section h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 16px;
}

.help-section p {
  margin: 0;
}

.help-section p + p {
  margin-top: 8px;
}

.help-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.help-version {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.help-token-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 8px;
  margin: 7px 0;
}

.help-token {
  min-width: 30px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
}

.help-inline-token {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.45;
}

/* Riproduce l’alfa del pulsante attivo nella guida. */
.help-greek-token {
  background: var(--accent);
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.12em;
  font-weight: 800;
}

.help-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f0f0f0;
}

@media (min-width: 760px) {
  .content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .book-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .reader-search {
    width: min(100%, 940px);
    margin: 0 auto;
  }

  .panel-backdrop {
    align-items: center;
  }

  .sheet {
    border-radius: 16px;
  }

  .settings-sheet {
    border-radius: 30px;
  }

  .panel-backdrop.settings-backdrop {
    align-items: start;
  }

  .panel-backdrop.user-report-backdrop {
    align-items: start;
  }

  .user-report-backdrop > .user-report-sheet {
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 430px) {
  .toolbar-side {
    gap: 1px;
  }

  .icon-btn {
    width: 31px;
  }

  .app-brand {
    font-size: 15px;
  }

  .content,
  .reader-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .calendar-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .calendar-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .calendar-entry {
    grid-template-columns: minmax(74px, 27%) minmax(0, 1fr);
  }

  .calendar-cell {
    padding: 9px 9px;
    font-size: 15px;
  }

  .calendar-supplements {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 13px;
  }

  .calendar-page-notes {
    padding-left: 10px;
    padding-right: 10px;
  }

  .calendar-docx-content {
    padding-left: 7px;
    padding-right: 7px;
  }

  .calendar-docx-introduction {
    padding: 14px 12px 16px;
    font-size: 15px;
  }

  .calendar-docx-introduction h2 {
    font-size: 18px;
  }

  .calendar-introduction-table.lectio-plan .calendar-introduction-row {
    grid-template-columns: minmax(130px, 42%) minmax(0, 1fr);
    gap: 6px;
  }

  .calendar-docx-heading {
    font-size: 17px;
  }

  .calendar-docx-separator {
    font-size: 16px;
  }

  .calendar-docx-day-title {
    font-size: 16px;
  }

  .calendar-docx-preface,
  .calendar-docx-date,
  .calendar-docx-label,
  .calendar-docx-readings {
    font-size: 15px;
  }

  .calendar-docx-row {
    grid-template-columns: minmax(78px, 27%) minmax(0, 1fr);
  }

  .calendar-docx-label,
  .calendar-docx-readings {
    padding-left: 6px;
    padding-right: 6px;
  }

  .book-grid {
    gap: 7px 6px;
  }

  .settings-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .settings-head {
    padding-left: 18px;
    padding-right: 18px;
  }

  .settings-head h2 {
    font-size: 22px;
  }

  .settings-done {
    min-height: 46px;
    padding: 0 20px;
    font-size: 21px;
  }

  .settings-group-title,
  .ios-slider-label label,
  .ios-slider-label output,
  .settings-select-row,
  .settings-toggle-row {
    font-size: 20px;
  }

  .user-report-mode-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-report-head {
    align-items: flex-start;
  }

  .user-report-ordering {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .user-report-sort-control button {
    padding: 0 10px;
    font-size: 13px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .user-report-print-area,
  .user-report-print-area * {
    visibility: visible;
  }

  .print-hidden,
  .sheet-head {
    display: none !important;
  }

  .panel-backdrop {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
  }

  .sheet,
  .settings-sheet {
    width: auto;
    max-height: none;
    margin: 0;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet-body {
    overflow: visible;
    padding: 0;
  }

  .user-report-print-area {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    display: block;
    background: #fff;
    color: #000;
  }

  .user-report-row {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #c9c9c9;
  }

  .user-report-row h4 a {
    color: #000;
    text-decoration: underline;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (hover: none) and (pointer: coarse) {
  .reader-topbar {
    display: none;
  }

  .reader-body {
    width: 100%;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-right: calc(14px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(14px + env(safe-area-inset-left, 0px));
  }
}

/* Context return is distinct from the book/index navigation chevron. */
.context-return-btn {
  flex-shrink: 0;
  color: #075985;
  background: #e0f2fe;
  border: 2px solid #075985;
}
.context-return-btn svg { display: block; }

.settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; flex-shrink: 0; border-bottom: 1px solid #ccd4dd; background: #f1f4f8; }
.settings-tabs [role="tab"] { flex: 1 1 140px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #a9b6c6; border-radius: 8px 8px 3px 3px; background: white; color: #223349; font: inherit; font-size: 14px; cursor: pointer; }
.settings-tabs [aria-selected="true"] { background: #075985; color: white; border-color: #075985; font-weight: 700; }
.settings-tabs [role="tab"]:focus-visible { outline: 3px solid #d97706; outline-offset: 2px; }
.settings-body [role="tabpanel"][hidden] { display: none; }
@media (max-width: 480px) { .settings-tabs { gap: 4px; padding: 8px; } .settings-tabs [role="tab"] { flex-basis: 125px; font-size: 13px; padding: 6px; } }
.settings-head [data-settings-reset] { justify-self: start; }
@media (max-width: 480px) {
  .settings-head { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .settings-head .settings-done { padding: 0 12px; font-size: 16px; min-height: 44px; }
  .settings-head h2 { font-size: 21px; }
}

@media screen {
  .panel-backdrop.panel-backdrop-top {
    align-items: start;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .panel-backdrop-top > .sheet {
    border-radius: 16px;
    max-height: min(82vh, 720px);
    max-height: min(82dvh, 720px);
  }
  .panel-backdrop.panel-backdrop-fullscreen {
    padding: 0;
  }
  .panel-backdrop-fullscreen > .sheet {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  .panel-backdrop-fullscreen > .sheet > .sheet-head {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .panel-backdrop-fullscreen > .guide-sheet > .guide-head {
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .panel-backdrop-fullscreen > .sheet > .sheet-body {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}

.guide-version { color: var(--muted); font-size: 13px; }
.guide-sheet [role="tabpanel"][hidden] { display: none; }
.guide-tabs { overflow-y: auto; max-height: 40dvh; }

.guide-head .guide-version { justify-self: start; min-width: 0; overflow-wrap: anywhere; }
.guide-head h2 { text-align: center; }
.guide-head { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }

/* Match the spacing between separate guide sections for internal headings. */
.help-section > h3:not(:first-child) { margin-top: 18px; }

/* Testo ebraico e glosse italiane con direzioni di scrittura separate. */
.hebrew-mode-btn {
  font-family: "Times New Roman", serif;
  font-weight: 800;
}
.hebrew-mode-btn[hidden] {
  display: none;
}
.hebrew-verse-text {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: var(--reader-font);
  font-size: var(--hebrew-font-size, var(--reader-font-size, 20px));
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.latin-verse-text {
  margin: 0;
  direction: ltr;
  text-align: left;
  font-family: var(--reader-font);
  font-size: var(--latin-font-size, var(--reader-font-size, 20px));
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 360px) {
  .reader-topbar .topbar-main {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .reader-topbar .toolbar-side.end {
    flex-wrap: wrap;
    row-gap: 3px;
  }
}

/* Uniforma l’altezza visiva della L maiuscola ad alfa e alef. */
.latin-mode-btn {
  font-size: 18px;
}
.latin-mode-btn > span {
  transform: translateY(1.5px);
}
.help-greek-token[lang="la"] {
  font-size: 0.9em;
}

.sacred-language-controls {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #d5d5da;
  border-radius: 9px;
}
.sacred-language-controls .icon-btn {
  flex-shrink: 0;
  border-radius: 0;
}
.sacred-language-divider {
  display: inline-grid;
  place-items: center;
  align-self: stretch;
  width: 7px;
  color: var(--muted);
  font: 20px/1 system-ui, sans-serif;
  user-select: none;
}
.sacred-language-divider[hidden] {
  display: none;
}

/* Main Bible text and availability follow the selected source. */
.book-btn:disabled,
.chapter-btn:disabled,
.book-btn:disabled:active,
.chapter-btn:disabled:active {
  color: #b9bcc1;
  background: #f7f7f8;
  border-color: #ececef;
  cursor: default;
}

.text-language-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.text-language-option { position: relative; cursor: pointer; min-width: 0; }
.text-language-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.text-language-option span {
  display: block;
  text-align: center;
  padding: 10px 4px;
  font-size: 14px;
  border: 1px solid #d5d5da;
  border-radius: 8px;
  font-weight: 700;
}
.text-language-option input:checked + span { color: #fff; background: var(--accent); border-color: var(--accent); }
.text-language-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.reader-body[data-language="latin"],
.reader-body[data-language="greek"] { font-family: var(--reader-font); }
.reader-body[data-language="greek"] { font-size: var(--greek-font-size, var(--reader-font-size, 20px)); line-height: 1.42; }
.reader-body[data-language="hebrew"] {
  font-family: var(--reader-font);
  font-size: var(--hebrew-font-size, var(--reader-font-size, 20px));
  text-align: right;
  line-height: 1.42;
}
.reader-body[data-language]:not([data-language="italian"]) .verse-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.italian-verse-text { margin: 0; font-family: var(--reader-font); font-size: var(--reader-font-size, 20px); line-height: 1.42; }

.text-language-options + .settings-note { margin-top: 12px; }

.reader-body[data-language="latin"] { font-size: var(--latin-font-size, var(--reader-font-size, 20px)); }
.language-font-row + .language-font-row { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 12px; }
.language-font-row .language-font-symbol { display: inline-block; font-family: Georgia, "Times New Roman", serif; font-size: 25px; line-height: 1; }
.language-font-row .language-font-preview { margin-top: 8px; overflow-wrap: anywhere; line-height: 1.42; }
/* Keep all three controls on one line, including on narrow phones. */
.language-font-controls { display: grid; grid-template-columns: 26px minmax(0, 1fr) 52px; align-items: center; gap: 12px; margin-top: 8px; min-height: 40px; }
.language-font-controls label { display: grid; place-items: center; }
.language-font-buttons { display: flex; justify-content: center; gap: 10px; }
.language-font-buttons .slider-stepper { width: 44px; height: 44px; min-width: 0; flex: 0 0 44px; }
.language-font-buttons input[type="range"] { display: block; width: 100%; min-width: 0; flex: 1 1 0; margin: 0; accent-color: #9f2d31; }
.language-font-buttons .slider-stepper:disabled { opacity: .35; cursor: default; }
.language-font-controls output { text-align: right; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.language-font-row[data-font-language="italian"] .language-font-symbol,
.language-font-row[data-font-language="latin"] .language-font-symbol { font-size: 18px; }
.language-font-row .copy-preview { color: #111; }
.language-font-row .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 480px) {
  #settings-panel-screen .settings-card,
  #settings-panel-copy .settings-card { padding-left: 8px; padding-right: 8px; }
  #settings-panel-screen .ios-slider-box,
  #settings-panel-copy .ios-slider-box { padding-left: 6px; padding-right: 6px; }
  .language-font-controls { grid-template-columns: 18px minmax(0, 1fr) 44px; gap: 6px; }
  .language-font-buttons { gap: 6px; }
}

/* I numeri in apice non devono aumentare la distanza fra le righe del testo. */
.reader-body[data-language="greek"] .verse-number,
.reader-body[data-language="hebrew"] .verse-number,
.language-font-row[data-font-context="screen"][data-font-language="greek"] .screen-preview-verse,
.language-font-row[data-font-context="screen"][data-font-language="hebrew"] .screen-preview-verse { line-height: 0; }

/* Stessi font delle icone reali, glifi compensati per altezza visiva uniforme. */
.guide-language-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 1.35em;
  height: 1.45em;
  margin: 0 0.08em;
  padding: 0 0.35em;
  border: 1px solid #d5d5da;
  border-radius: 4px;
  background: #ececef;
  color: #242429;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1em;
  font-weight: 800;
  line-height: 1;
  vertical-align: -0.22em;
}
.guide-language-symbol > span { display: block; line-height: 1; }
.guide-language-symbol[lang="it"] > span,
.guide-language-symbol[lang="la"] > span { font-size: 1.05em; }
.guide-language-symbol[lang="el"] > span { font-size: 1.46em; }
.guide-language-symbol[lang="he"] { font-family: "Times New Roman", serif; }
.guide-language-symbol[lang="he"] > span { font-size: 1.31em; }

.hebrew-interlinear-word {
  display: inline-block;
  max-width: 100%;
  direction: rtl;
  unicode-bidi: isolate;
  vertical-align: baseline;
  white-space: normal;
}
.hebrew-gloss {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
  white-space: normal;
  overflow-wrap: anywhere;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--reader-font);
  font-size: var(--reader-font-size, 20px);
  color: #555;
}

/* Lingue in due colonne con scelte indipendenti. */
.reading-columns {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px;}
.reading-column {min-width:0;}
.reading-column fieldset {border:0; padding:0; margin:10px 0 0; min-width:0; display:grid; gap:8px;}
.reading-column fieldset:disabled {opacity:.4;}
.reading-mode, .reading-language-row button {width:100%; min-height:44px; padding:8px 4px; border:1px solid #d5d5da; border-radius:8px; background:#fff; color:var(--text); font:inherit; font-size:14px; font-weight:700; cursor:pointer;}
.reading-mode {min-height:52px;}
.reading-mode[aria-pressed="true"], .reading-language-row button[aria-pressed="true"] {color:#fff; background:var(--accent); border-color:var(--accent);}
.reading-language-row {display:grid; grid-template-columns:minmax(0,1fr) 22px; gap:6px; align-items:center;}
.reading-language-row input {width:20px; height:20px; margin:0; accent-color:var(--accent);}
.reading-column button:focus-visible, .reading-column input:focus-visible {outline:2px solid var(--accent); outline-offset:2px;}
.reader-body .alternating-verse {display:block; margin:0; padding:4px 0; line-height:1.42;}
.reader-body .alternating-verse.verse-group-start {margin-top:16px;}
.reader-body .verse[data-language="italian"] {font-size:var(--reader-font-size,20px);}
.reader-body .verse[data-language="latin"] {font-size:var(--latin-font-size,20px);}
.reader-body .verse[data-language="greek"] {font-size:var(--greek-font-size,26px);}
.reader-body .verse[data-language="hebrew"] {font-size:var(--hebrew-font-size,34px); direction:rtl; text-align:right;}
.reader-body .verse[data-language="hebrew"] .verse-text, .reader-body .verse[data-language="greek"] .verse-text {overflow-wrap:anywhere; white-space:pre-wrap;}

/* Sostituzioni delle glosse nel pop-up delle lingue originali. */
.popup-gloss-help {font-size:14px; line-height:1.4; margin:0 0 12px; color:#555;}
.popup-gloss-editing [data-gloss-start],
.reader-gloss-editing [data-gloss-start] {cursor:pointer; border-radius:3px; outline:1px dashed #b7b7bd; outline-offset:1px;}
.popup-gloss-editing [data-gloss-start]:hover,
.reader-gloss-editing [data-gloss-start]:hover {background:#fff0a6;}

/* Selettore ricerca inattivo nelle modalità che non permettono di cambiarla. */
.mode-toggle:disabled {color:#929298; background:#f2f2f4; border-color:#dedee3; cursor:default;}

.reader-body.reader-gloss-editing [data-gloss-start].annotation-selection {background:#fff0a6;}
.reader-body.reader-gloss-editing .verse:not([data-language="italian"]) .verse-text {cursor:default;}
.reader-body.reader-gloss-editing [data-gloss-start] {cursor:pointer;}
