/* ===========================================================
   Cao Đài — Thánh Giáo & Thư Viện
   Mobile-first PWA styles
   =========================================================== */

:root {
  /* Palette — light (calm cream + Cao Đài gold) */
  --bg: #f6f1e7;
  --bg-elev: #fffdf8;
  --card: #fffdf8;
  --card-border: #e7dcc4;
  --text: #2b2622;
  --text-soft: #6b6152;
  --text-faint: #9a8f7c;
  --gold: #b8860b;
  --gold-deep: #8a6508;
  --gold-soft: #f2e6c7;
  --azure: #2a6f97;
  --crimson: #b23a48;
  --accent: var(--gold);
  --shadow: 0 2px 10px rgba(80, 60, 20, 0.08);
  --shadow-lg: 0 8px 28px rgba(80, 60, 20, 0.16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --tabbar-h: 60px;
  --read-scale: 1;
  --radius: 16px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  /* Chữ đọc kinh: Times New Roman trước tiên.
     Tinos / Liberation Serif là bản thay thế cùng kích thước chữ trên Android & Linux. */
  --font-read: "Times New Roman", Times, Tinos, "Liberation Serif", "Nimbus Roman", "Droid Serif", "Noto Serif", serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #171410;
  --bg-elev: #211d17;
  --card: #211d17;
  --card-border: #362f24;
  --text: #ece5d6;
  --text-soft: #b8ad97;
  --text-faint: #877d68;
  --gold: #e2b544;
  --gold-deep: #f0c86a;
  --gold-soft: #33291641;
  --azure: #6db3d8;
  --crimson: #e08691;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* touch-action: manipulation = tắt "chạm 2 lần để phóng to" (người dùng 01/11/2026: bấm nhanh nút tốc độ
   trong Chế độ tụng làm chữ phóng to / thu nhỏ). Vẫn cuộn và vẫn phóng to bằng hai ngón tay như thường. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------------- Header ---------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  padding-right: 8px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.hdr-title {
  flex: 1;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdr-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 40px;
}
.hdr-btn:active { background: var(--gold-soft); }
.hdr-btn[hidden] { visibility: hidden; display: grid; }
/* Nút bên phải thanh tiêu đề: ẩn hẳn để nhường chỗ cho tiêu đề */
.hdr-btn.act[hidden] { display: none; }
.hdr-btn.aa { font: 700 1.05rem/1 var(--font-serif); letter-spacing: -0.02em; }

/* ---------------- View / scroll area ---------------- */
.view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  outline: none;
  animation: fade 0.28s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }

.section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 22px 4px 10px;
  font-weight: 700;
}
.section-title:first-child { margin-top: 4px; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Daily verse hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%),
    var(--card);
}
/* Biểu tượng Xuân Thu – Phất Chủ – Bát Vu: đặt HẲN LÊN TRÊN, trong dòng chảy
   bình thường của thẻ. Trước đây dùng position:absolute nên nó nằm đè lên
   câu thánh giáo và che mất chữ trên màn hình điện thoại. */
.hero .eye {
  display: block;
  margin: 0 auto 10px;
  width: 64px; height: 64px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.hero .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hero .verse {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.5;
  white-space: pre-line;
  color: var(--text);
  margin: 4px 0 12px;
}
.hero .verse-source {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-style: italic;
}
.hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--card-border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff;
  border-color: transparent;
}
:root[data-theme="dark"] .btn.primary { color: #1a1408; }
.btn.active-fav { color: var(--crimson); border-color: color-mix(in srgb, var(--crimson) 45%, var(--card-border)); }

/* List rows (books) */
.book-list { display: flex; flex-direction: column; gap: 10px; }
.book-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
}
.book-cover {
  flex: 0 0 52px;
  width: 52px; height: 66px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
  box-shadow: var(--shadow);
  background: linear-gradient(150deg, var(--gold), var(--gold-deep));
}
.book-cover.c-thanh-ngon { background: linear-gradient(150deg, #c98a2b, #8a5a12); }
.book-cover.c-luat-phap { background: linear-gradient(150deg, #b23a48, #7d2530); }
.book-cover.c-giao-ly { background: linear-gradient(150deg, #2a6f97, #184b6b); }
.book-cover.c-kinh { background: linear-gradient(150deg, #b8860b, #7d5a08); }
.book-meta { flex: 1; min-width: 0; }
.book-meta h3 { margin: 0 0 3px; font-size: 1.02rem; font-weight: 700; }
.book-meta p { margin: 0; font-size: 0.85rem; color: var(--text-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-meta .tag { font-size: 0.74rem; color: var(--gold-deep); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.chev { flex: 0 0 auto; color: var(--text-faint); }

/* Chips / filter */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -4px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--card-border);
  background: var(--bg-elev);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--gold-soft); color: var(--gold-deep); border-color: color-mix(in srgb, var(--gold) 40%, var(--card-border)); }

/* Chapters list */
.chapter-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.chapter-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; text-decoration: none; color: inherit;
}
.chapter-num {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-deep);
  font-weight: 700; font-size: 0.9rem;
}
.chapter-row h3 { margin: 0; font-size: 0.98rem; font-weight: 600; }
.chapter-row p { margin: 2px 0 0; font-size: 0.82rem; color: var(--text-soft); }
.chapter-row.current { box-shadow: 0 0 0 2px var(--gold) inset; }
.chapter-row.current .chapter-num { background: var(--gold); color: #fff; }

/* Mục lục & tra cứu trong quyển (js/feat-toc.js) */
.toc-search {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 4px;
  padding: 0 12px; height: 44px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--card-border);
}
.toc-search svg { width: 18px; height: 18px; color: var(--text-faint); flex: 0 0 auto; }
.toc-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--text);   /* 16px: iPhone không tự phóng to khi gõ */
}
.toc-group { margin-top: 10px; }
.toc-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 4px; font-weight: 700; font-size: 0.92rem; color: var(--gold-deep);
}
.toc-group > summary::-webkit-details-marker { display: none; }
.toc-group > summary::before {
  content: ""; width: 8px; height: 8px; flex: 0 0 auto; margin: 0 4px 2px 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.toc-group[open] > summary::before { transform: rotate(45deg); }
.toc-group > summary > span:first-child { flex: 1; min-width: 0; }
.toc-count { font-weight: 600; font-size: 0.78rem; color: var(--text-faint); }
.link-btn {
  border: 0; background: transparent; color: var(--azure); font: inherit; font-size: 0.8rem;
  font-weight: 700; cursor: pointer; padding: 0 0 0 8px; text-transform: none; letter-spacing: 0;
}
.result-list { padding: 0; overflow: hidden; }

/* Bảng mục lục nhanh trong trang đọc */
.ts-links { display: flex; gap: 8px; margin: 8px 0 4px; }
.ts-links .btn { flex: 1; justify-content: center; }
.ts-heads { display: flex; flex-direction: column; gap: 2px; }
.ts-head {
  text-align: left; border: 0; background: transparent; cursor: pointer; color: var(--text);
  font: inherit; font-size: 0.88rem; padding: 9px 10px; border-radius: 10px;
}
.ts-head:active, .ts-head:hover { background: var(--gold-soft); }
.ts-list { display: flex; flex-direction: column; }
.ts-group {
  font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gold-deep); padding: 12px 10px 4px;
}
.ts-item {
  display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: var(--text); font-size: 0.92rem;
}
.ts-item:hover { background: var(--gold-soft); }
.ts-item.on { background: var(--gold-soft); font-weight: 700; }
.ts-num { flex: 0 0 26px; color: var(--text-faint); font-size: 0.78rem; text-align: right; }
.ts-t { flex: 1; min-width: 0; }
.ts-t small { display: block; color: var(--text-soft); font-weight: 400; font-size: 0.78rem; margin-top: 1px; }

/* Book header (detail) */
.book-hero { display: flex; gap: 16px; padding: 18px; align-items: center; }
.book-hero .book-cover { width: 66px; height: 84px; font-size: 1.7rem; }
.book-hero h2 { margin: 0 0 4px; font-size: 1.2rem; }
.book-hero p { margin: 0; color: var(--text-soft); font-size: 0.86rem; }

/* ---------------- Reader ----------------
   Trình bày theo yêu cầu: Times New Roman, cỡ 13, canh đều hai bên,
   cách đoạn trên 3pt / dưới 3pt — và bố cục kiểu app đọc Kinh Thánh:
   số câu là chữ nhỏ đặt ngay đầu câu, chữ chạy hết bề ngang trang. */
.reader { max-width: 720px; margin: 0 auto; }
.reader-title {
  font-family: var(--font-read);
  font-size: calc(1.5rem * var(--read-scale));
  margin: 6px 0 2px;
  line-height: 1.3;
}
.reader-sub { color: var(--text-soft); font-size: calc(0.9rem * var(--read-scale)); margin: 0 0 18px; font-style: italic; }
.reader-book { color: var(--gold-deep); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }

.verse-block {
  position: relative;
  /* Cách đoạn: trên 3pt, dưới 3pt (như Word) */
  padding: 3pt 2px;
  border-radius: 10px;
  /* Canh đều phải đặt ở thẻ khối này, vì .vtext là thẻ inline.
     Dòng thơ ngắn không bị kéo giãn: trình duyệt không canh đều dòng cuối,
     mà mỗi câu thơ chính là dòng cuối của khối. */
  text-align: justify;
  text-justify: inter-word;
  font-family: var(--font-read);
  font-size: calc(13pt * var(--read-scale));
  line-height: var(--read-lh, 1.62);
}
.verse-block:active { background: var(--gold-soft); }
.verse-block .vtext {
  white-space: pre-line;
  color: var(--text);
  hyphens: none;
}

/* Tiêu đề mục bên trong một chương — như đầu mục trong Kinh Thánh */
.verse-block.vb-h {
  text-align: left;
  margin: 16px 0 2px;
  padding-bottom: 0;
}
.verse-block.vb-h .vtext {
  font-family: var(--font-ui);
  font-size: calc(10.5pt * var(--read-scale));
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--gold-deep);
  display: block;
}
.verse-block.vb-h:first-child { margin-top: 2px; }

/* Lời thánh ngôn của các Đấng — bản in để chữ nghiêng */
.verse-block.vb-q .vtext { font-style: italic; }
.verse-block.vb-q {
  border-left: 2px solid var(--gold-soft);
  padding-left: 12px;
  margin-left: 2px;
}

/* Thơ: giữ nguyên xuống dòng, không kéo giãn canh đều */
.verse-block.vb-v { text-align: left; }

/* Phần đầu đoạn in đậm: "ĐIỀU THỨ NHỨT. ─", "P. C. T. ─", "C. G. ─" */
.verse-block .vlead { font-weight: 700; font-style: normal; color: var(--text); }
.verse-block.vb-q .vlead { color: var(--gold-deep); }

/* Dòng canh giữa: ngày giờ, nơi đàn cơ, chữ ký cuối bài */
.verse-block.vb-c { text-align: center; }
.verse-block.vb-c .vtext { color: var(--text-soft); font-size: 0.92em; }

/* Ghi chú / chú thích cuối trang của bản in, ghi chú đối chiếu ấn bản */
.verse-block.vb-n { text-align: left; padding-left: 12px; }
.verse-block.vb-n .vtext {
  font-family: var(--font-ui); font-size: 0.8em; line-height: 1.5; color: var(--text-soft);
}
.verse-block.vb-n::before {
  content: ""; position: absolute; left: 2px; top: 9px; bottom: 9px; width: 2px;
  border-radius: 2px; background: var(--card-border);
}
/* (11/10/2026) Bỏ nút trái tim trên từng đoạn kinh — che khuất chữ; lưu bằng bảng chức năng. */

.reader-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }
.reader-nav .btn { flex: 1; justify-content: center; }
.reader-nav .btn.disabled { opacity: 0.4; pointer-events: none; }

/* ---------------- Search ---------------- */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 999px; padding: 10px 16px; box-shadow: var(--shadow);
}
.search-box svg { flex: 0 0 auto; color: var(--text-faint); }
.search-box input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 1rem; color: var(--text); font-family: inherit;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-clear { border: 0; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 1.2rem; padding: 0 4px; }

.result-row { display: block; padding: 14px; text-decoration: none; color: inherit; }
.result-row + .result-row { border-top: 1px solid var(--card-border); }
.result-src { font-size: 0.76rem; color: var(--gold-deep); font-weight: 700; margin-bottom: 4px; }
.result-text { font-family: var(--font-serif); font-size: 1rem; line-height: 1.5; }
.result-text mark { background: color-mix(in srgb, var(--gold) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------------- Settings ---------------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 16px;
}
.setting-row + .setting-row { border-top: 1px solid var(--card-border); }
.setting-row .label { font-weight: 600; }
.setting-row .desc { font-size: 0.82rem; color: var(--text-soft); margin-top: 2px; }

/* toggle */
.switch { position: relative; width: 50px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: var(--card-border); transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.fontsize-control { display: flex; align-items: center; gap: 12px; }
.fontsize-control button {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--card-border);
  background: var(--bg-elev); color: var(--text); font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.fontsize-control .val { min-width: 44px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- Misc ---------------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: color-mix(in srgb, var(--gold) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--card-border));
  border-radius: 12px; padding: 12px 14px; font-size: 0.84rem; color: var(--text-soft);
  margin-top: 14px;
}
.notice svg { flex: 0 0 auto; color: var(--gold-deep); margin-top: 1px; }

.empty {
  text-align: center; color: var(--text-faint); padding: 48px 20px;
}
.empty svg { width: 54px; height: 54px; opacity: 0.5; margin-bottom: 12px; }
.empty p { margin: 6px 0 0; }

.about p { color: var(--text-soft); font-size: 0.92rem; }
.about a { color: var(--azure); }

.divider { height: 1px; background: var(--card-border); margin: 4px 0; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
  max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Tabbar ---------------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--card-border);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--text-faint); font-size: 0.66rem; font-weight: 600;
  white-space: nowrap; min-width: 0;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--gold-deep); }
.tab:active { opacity: 0.7; }

@media (min-width: 720px) {
  .view { padding-left: max(16px, calc((100% - 720px) / 2)); padding-right: max(16px, calc((100% - 720px) / 2)); }
}

/* ---------------- PDF cover + viewer ---------------- */
.book-cover.c-pdf { background: linear-gradient(150deg, #c0392b, #7d2018); }
.book-cover svg { width: 26px; height: 26px; }

.pdf-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.pdf-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pdf-actions .btn { flex: 1; justify-content: center; min-width: 140px; }
.pdf-frame-wrap {
  border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden;
  background: var(--bg-elev); box-shadow: var(--shadow);
}
.pdf-frame { width: 100%; height: 72vh; border: 0; display: block; background: #fff; }
.pdf-hint { color: var(--text-faint); font-size: 0.82rem; margin: 12px 4px 0; text-align: center; }

/* ---------------- Stats card (home) ---------------- */
.stat-card {
  display: flex; margin-top: 14px; padding: 6px 0; text-decoration: none; color: inherit;
}
.stat { flex: 1; text-align: center; padding: 8px 4px; position: relative; }
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 18%; height: 64%; width: 1px; background: var(--card-border);
}
.stat-num {
  font-size: 1.5rem; font-weight: 800; color: var(--gold-deep); line-height: 1.1;
  display: inline-flex; align-items: center; gap: 3px;
}
.stat-num svg { width: 18px; height: 18px; color: var(--crimson); }
.stat-lbl { font-size: 0.72rem; color: var(--text-soft); margin-top: 2px; }

/* ---------------- Stats page ---------------- */
.stat-row3 { display: flex; gap: 10px; }
.tile { flex: 1; text-align: center; padding: 16px 6px; }
.tile-num {
  font-size: 1.7rem; font-weight: 800; color: var(--gold-deep); line-height: 1;
  display: inline-flex; align-items: center; gap: 4px;
}
.tile-num svg { width: 20px; height: 20px; color: var(--crimson); }
.tile-lbl { font-size: 0.74rem; color: var(--text-soft); margin-top: 5px; }

.chart-card { padding: 16px 12px; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 172px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 0.7rem; color: var(--text-faint); height: 14px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar-track { width: 72%; flex: 1; display: flex; align-items: flex-end; }
.bar-fill {
  width: 100%; border-radius: 7px 7px 2px 2px; min-height: 0;
  background: linear-gradient(var(--gold), var(--gold-deep)); transition: height .4s ease;
}
.bar-fill.today { background: linear-gradient(var(--azure), #1c4f6e); }
.bar-lbl { font-size: 0.72rem; color: var(--text-soft); margin-top: 6px; }

/* ---------------- Settings extras ---------------- */
.time-input {
  border: 1px solid var(--card-border); background: var(--bg-elev); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 700;
}
.btn-row { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.btn-row .label { color: var(--gold-deep); }

/* ---------------- Tô màu (highlight) ---------------- */
:root {
  --hl-vang: #ffe9a8;
  --hl-xanh: #c9ecc9;
  --hl-hong: #ffd4dd;
  --hl-tim: #e0d4f7;
}
:root[data-theme="dark"] {
  --hl-vang: #5a4713;
  --hl-xanh: #1f4326;
  --hl-hong: #55202e;
  --hl-tim: #382a53;
}
.verse-block.hl, .result-row.hl { border-radius: 10px; }
.hl-vang { background: var(--hl-vang); }
.hl-xanh { background: var(--hl-xanh); }
.hl-hong { background: var(--hl-hong); }
.hl-tim  { background: var(--hl-tim); }
.verse-block .vtext { cursor: pointer; }

/* Ghi chú dưới câu */
.vnote {
  display: flex; gap: 7px; align-items: flex-start;
  margin: 8px 0 2px; padding: 9px 12px;
  background: color-mix(in srgb, var(--azure) 10%, var(--card));
  border-left: 3px solid var(--azure);
  border-radius: 8px;
  font-size: calc(0.86rem * var(--read-scale));
  color: var(--text-soft);
  font-family: var(--font-ui);
  text-align: left;             /* ghi chú không canh đều */
  line-height: 1.5;
}
.vnote svg { flex: 0 0 auto; color: var(--azure); margin-top: 1px; }

/* ---------------- Action sheet ---------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.42);
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity 0.2s;
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  width: 100%;
  max-width: 560px; margin: 0 auto;
  background: var(--bg-elev);
  border-radius: 20px 20px 0 0;
  padding: 10px 12px calc(14px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform 0.25s ease;
  max-height: 86vh; overflow-y: auto;
}
.sheet-backdrop.show .sheet { transform: none; }
.sheet-quote {
  font-family: var(--font-serif); font-size: 1rem; line-height: 1.5;
  color: var(--text-soft); padding: 10px 8px 14px; text-align: center;
  border-bottom: 1px solid var(--card-border); margin-bottom: 8px;
  white-space: pre-line;
}
.sheet-colors { display: flex; gap: 12px; justify-content: center; padding: 12px 4px 16px; }
.swatch {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--card-border); cursor: pointer;
  display: grid; place-items: center; font-size: 1rem; color: var(--text-faint);
}
.swatch.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent); }
.sw-vang { background: var(--hl-vang); }
.sw-xanh { background: var(--hl-xanh); }
.sw-hong { background: var(--hl-hong); }
.sw-tim  { background: var(--hl-tim); }
.sw-none { background: transparent; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 14px; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--text); text-align: left;
  border-radius: 12px;
}
.sheet-item:active { background: var(--gold-soft); }
.sheet-item svg { flex: 0 0 auto; color: var(--gold-deep); }
.sheet-item.cancel { justify-content: center; color: var(--text-faint); font-weight: 700; }

/* ---------------- Segmented control ---------------- */
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 999px; margin-bottom: 14px;
}
.seg {
  flex: 1; border: 0; background: none; cursor: pointer;
  padding: 9px 8px; border-radius: 999px;
  font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--text-soft);
}
.seg.on { background: var(--gold-soft); color: var(--gold-deep); }

.row-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.row-actions .btn { padding: 7px 12px; font-size: 0.84rem; }

/* ---------------- Doan duoc dan toi tu "Doc nguon" ---------------- */
.verse-block.target {
  background: color-mix(in srgb, var(--gold) 26%, transparent);
  border-radius: 10px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent);
  transition: background 1.2s ease, box-shadow 1.2s ease;
}
.verse-block.target.faded {
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  box-shadow: none;
}

/* Nhan "ban scan (OCR)" trong ket qua tim kiem */
.ocr-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--azure);
  background: color-mix(in srgb, var(--azure) 14%, transparent);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
}

/* ---------------- Ke hoach doc kinh ---------------- */
.plan-card { display: block; padding: 14px; text-decoration: none; color: inherit; }
.plan-top { display: flex; align-items: center; gap: 12px; }
.plan-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-deep);
}
.plan-card h3 { margin: 0 0 2px; font-size: 1rem; font-weight: 700; }
.plan-card p {
  margin: 0; font-size: 0.84rem; color: var(--text-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.plan-meta {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-faint); font-weight: 600;
  margin-top: 10px;
}
.pbar {
  height: 6px; border-radius: 999px; background: var(--card-border);
  overflow: hidden; margin-top: 6px;
}
.pbar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width .3s ease;
}

.plan-invite {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  margin-top: 14px; text-decoration: none; color: inherit;
}
.plan-invite > svg { flex: 0 0 auto; color: var(--gold-deep); }
.plan-invite div { flex: 1; display: flex; flex-direction: column; }
.plan-invite b { font-size: 0.98rem; }
.plan-invite span { font-size: 0.82rem; color: var(--text-soft); }

.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.day-row.done { opacity: 0.65; }
.day-check {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--card-border); background: transparent;
  cursor: pointer; display: grid; place-items: center; color: #fff; padding: 0;
}
.day-check.on { background: var(--gold); border-color: var(--gold); }
.day-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.day-num {
  font-size: 0.72rem; font-weight: 700; color: var(--gold-deep);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.day-main h3 { margin: 1px 0 0; font-size: 0.96rem; font-weight: 600; }
.day-main p { margin: 1px 0 0; font-size: 0.82rem; color: var(--text-soft); }
.day-row.done .day-main h3 { text-decoration: line-through; }

/* ---------------- PDF: che do toan man hinh trong app ---------------- */
.pdf-frame-wrap { position: relative; }
.pdf-exit { display: none; }

.pdf-frame-wrap.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 400;
  border: 0;
  border-radius: 0;
  background: var(--bg-elev);
}
.pdf-frame-wrap.fullscreen .pdf-frame {
  height: 100%;
  height: 100dvh;
}
.pdf-frame-wrap.fullscreen .pdf-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 12px;
  z-index: 401;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 16, 10, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.pdf-frame-wrap.fullscreen .pdf-exit:active { transform: scale(0.96); }

body.no-scroll { overflow: hidden; }

/* =========================================================
   BẢN 24 — các màn hình mới kiểu app Bible
   ========================================================= */

/* Nền "Giấy ngà" — dịu mắt khi đọc lâu */
:root[data-theme="sepia"] {
  --bg: #efe3c8;
  --bg-elev: #f6ecd6;
  --card: #f8efdb;
  --card-border: #dcc8a0;
  --text: #3b2f22;
  --text-soft: #6a5641;
  --text-faint: #957f63;
  --gold: #a87508;
  --gold-deep: #7a5405;
  --gold-soft: #ead7ad;
  --azure: #2c6a8a;
  --crimson: #a83a3f;
  --shadow: 0 2px 10px rgba(90, 60, 20, 0.10);
  --hl-vang: #f6dd8f;
  --hl-xanh: #c4e2b8;
  --hl-hong: #f4c6c6;
  --hl-tim: #dccbee;
  color-scheme: light;
}

.spinner {
  width: 30px; height: 30px; margin: 0 auto 10px; border-radius: 50%;
  border: 3px solid var(--card-border); border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.wide { width: 100%; justify-content: center; }
.btn.small { padding: 6px 12px; font-size: .82rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
a.btn.primary.wide { margin-top: 12px; }
.field {
  width: 100%; margin: 8px 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--bg-elev); color: var(--text);
  font: inherit; font-size: 1rem; resize: vertical;
}
.field:focus { outline: 2px solid color-mix(in srgb, var(--gold) 50%, transparent); outline-offset: 1px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0 0 4px; }
.badge {
  min-width: 24px; padding: 2px 8px; border-radius: 999px; text-align: center;
  background: var(--gold-soft); color: var(--gold-deep); font-size: .78rem; font-weight: 800;
}
.trad-tag {
  display: inline-block; font-style: normal; font-size: .68rem; font-weight: 700;
  color: var(--azure); background: color-mix(in srgb, var(--azure) 13%, transparent);
  border-radius: 999px; padding: 1px 8px; vertical-align: middle;
}

/* ---------- Hôm nay ---------- */
.today-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin: 0 4px 12px; text-decoration: none; color: var(--text-faint);
  font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.lunar-line { color: var(--gold-deep); text-transform: none; letter-spacing: 0; font-weight: 600; }
.feast-today {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  padding: 14px 16px; margin-bottom: 12px; cursor: pointer; font: inherit; color: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 22%, var(--card)), var(--card));
  border-color: color-mix(in srgb, var(--gold) 45%, var(--card-border));
}
.feast-today.lv-dai-le { background: linear-gradient(135deg, color-mix(in srgb, var(--crimson) 18%, var(--card)), var(--card)); }
.ft-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }
.feast-today b { font-size: 1.08rem; }
.ft-sub { font-size: .84rem; color: var(--text-soft); }
.hero-more {
  display: inline-flex; align-items: center; gap: 2px; margin-top: 12px;
  font-size: .84rem; font-weight: 700; color: var(--gold-deep); text-decoration: none;
}
.hero-more .chev { color: currentColor; width: 16px; height: 16px; }

.cal-mini { padding: 4px 0; }
.cm-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: inherit; }
.cm-row + .cm-row { border-top: 1px solid var(--card-border); }
.cm-row > svg { flex: 0 0 auto; color: var(--gold-deep); width: 22px; height: 22px; }
.cm-row div { display: flex; flex-direction: column; min-width: 0; }
.cm-row b { font-size: .96rem; }
.cm-row span { font-size: .82rem; color: var(--text-soft); }
.cm-btn { width: 100%; border: 0; border-top: 1px solid var(--card-border); background: none; font: inherit; text-align: left; cursor: pointer; }
.cm-btn b { color: var(--gold-deep); }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.quick {
  display: flex; align-items: center; gap: 10px; padding: 14px; text-decoration: none; color: inherit;
  font-weight: 700; font-size: .92rem;
}
.quick svg { flex: 0 0 auto; color: var(--gold-deep); }

.dict-banner { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 12px; text-decoration: none; color: inherit; }
.dict-banner > svg:first-child { color: var(--gold-deep); width: 26px; height: 26px; flex: 0 0 auto; }
.dict-banner div { flex: 1; display: flex; flex-direction: column; }
.dict-banner span { font-size: .82rem; color: var(--text-soft); }

.reader-hint { text-align: center; color: var(--text-faint); font-size: .8rem; margin: 18px 0 0; }

/* ---------- Bảng trượt ---------- */
.sheet.tall { max-height: 92vh; }
.sheet-title { font-weight: 800; font-size: 1.08rem; text-align: center; padding: 8px 8px 6px; }
.sheet-sub { text-align: center; color: var(--gold-deep); font-weight: 600; font-size: .86rem; margin: 0 0 8px; }
.sheet-desc { color: var(--text-soft); font-size: .9rem; margin: 6px 6px 10px; line-height: 1.55; }
.sheet-quote.small { font-size: .9rem; padding: 6px 8px 10px; }
.sheet-loading { padding: 40px; text-align: center; color: var(--text-faint); }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin: 10px 4px 4px; }
.sheet-actions.col { flex-direction: column; }
.sheet-actions .btn { flex: 1 1 auto; justify-content: center; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 0 8px; }
.sheet-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border: 0; background: none; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: .76rem; font-weight: 600; color: var(--text); text-align: center;
}
.sheet-tile:active { background: var(--gold-soft); }
.sheet-tile svg { width: 22px; height: 22px; color: var(--gold-deep); }
.sheet-terms { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 6px 12px; }
.sheet-terms[hidden] { display: none; }
.st-lbl { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--text-faint); width: 100%; }
.st-lbl svg { width: 15px; height: 15px; }
.term-chip { text-decoration: none; color: var(--gold-deep); background: var(--gold-soft); border-color: transparent; }
.howto { margin: 4px 6px 10px; padding-left: 20px; color: var(--text-soft); font-size: .9rem; line-height: 1.6; }
.howto li + li { margin-top: 6px; }

/* ---------- Điều chỉnh trang đọc ---------- */
.rc-card { padding: 6px 14px; }
.rc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; }
.rc-row + .rc-row { border-top: 1px solid var(--card-border); }
.rc-lbl { font-weight: 700; font-size: .9rem; flex: 0 0 auto; }
.check-row { justify-content: flex-start; font-size: .9rem; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--gold); }
.segmented.compact { margin: 0; flex: 1; max-width: 380px; }
.segmented.compact .seg { padding: 7px 4px; font-size: .78rem; }
.link-row { text-decoration: none; color: inherit; }
.row-ic svg { width: 20px; height: 20px; }
.btn, a.btn { text-decoration: none; }
.row-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-deep); }
.tt-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 16px 14px; }
.tt-check { position: relative; cursor: pointer; }
.tt-check input { position: absolute; opacity: 0; }
.tt-check span {
  display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px;
  border: 1.5px solid var(--card-border); font-weight: 800; font-size: .92rem;
}
.tt-check small { font-weight: 600; font-size: .74rem; color: var(--text-soft); }
.tt-check input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); }
.tt-check input:focus-visible + span { outline: 2px solid var(--gold); }

/* ---------- Lịch Đạo ---------- */
.cal-today { display: flex; overflow: hidden; }
.ct-solar {
  flex: 0 0 44%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 8px; color: #fff; background: linear-gradient(160deg, var(--gold), var(--gold-deep));
}
:root[data-theme="dark"] .ct-solar { color: #1a1408; }
.ct-wd { font-weight: 700; font-size: .9rem; opacity: .95; }
.ct-day { font-size: 3.6rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ct-my { font-size: .82rem; opacity: .95; }
.ct-lunar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 10px; text-align: center; }
.ct-l1 { font-size: 1.9rem; font-weight: 800; color: var(--gold-deep); line-height: 1.1; text-transform: capitalize; }
.ct-l2 { font-weight: 700; text-transform: capitalize; }
.ct-l3, .ct-l4 { font-size: .84rem; color: var(--text-soft); }
.ct-dl {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer;
  background: var(--gold-soft); color: var(--gold-deep); font: inherit; font-size: .78rem; font-weight: 800;
  border-radius: 999px; padding: 4px 10px;
}
.ct-dl svg { width: 14px; height: 14px; }

.thoi-card { padding: 14px; margin-top: 12px; }
.thoi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.thoi-head svg { color: var(--gold-deep); }
.thoi-head b { flex: 1; }
.thoi-src { border: 0; background: none; color: var(--azure); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.thoi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thoi { display: flex; flex-direction: column; align-items: center; padding: 10px 2px; border-radius: 12px; background: var(--bg); text-align: center; }
.thoi b { font-size: .95rem; }
.thoi span { font-size: .8rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.thoi small { font-size: .68rem; font-weight: 700; color: var(--gold-deep); margin-top: 2px; }
.thoi.next { background: var(--gold-soft); box-shadow: inset 0 0 0 1.5px var(--gold); }
.thoi.now { background: var(--gold); color: #fff; }
.thoi.now span, .thoi.now small { color: #fff; }
.thoi-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thoi-actions .btn { flex: 1; justify-content: center; font-size: .84rem; }

.month-card { padding: 10px 8px 12px; margin-top: 12px; }
.month-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.month-title { flex: 1; text-align: center; display: flex; flex-direction: column; }
.month-title b { font-size: 1.02rem; }
.month-title span { font-size: .78rem; color: var(--text-soft); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mg-wd { text-align: center; font-size: .72rem; font-weight: 800; color: var(--text-faint); padding: 4px 0; }
.mg-wd.cn, .mg-cell.cn .mg-s { color: var(--crimson); }
.mg-cell {
  position: relative; aspect-ratio: 1 / 1.08; min-height: 42px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; font: inherit; color: var(--text); padding: 0;
}
.mg-cell.empty { pointer-events: none; }
.mg-cell:active { background: var(--gold-soft); }
.mg-s { font-size: 1rem; font-weight: 700; line-height: 1.1; }
.mg-l { font-size: .66rem; color: var(--text-faint); font-weight: 600; }
.mg-cell.today { box-shadow: inset 0 0 0 2px var(--gold); }
.mg-cell.ev-dl:not(.sel) { background: color-mix(in srgb, var(--crimson) 14%, transparent); }
.mg-cell.ev-via:not(.sel) { background: color-mix(in srgb, var(--azure) 12%, transparent); }
.mg-cell.sel { background: var(--gold); }
.mg-cell.sel .mg-s, .mg-cell.sel .mg-l { color: #fff; }
.mg-cell .dot { position: absolute; bottom: 4px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.dot.dl { background: var(--crimson); }
.dot.via { background: var(--azure); }
.month-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; font-size: .74rem; color: var(--text-soft); }
.month-legend span { display: inline-flex; align-items: center; gap: 5px; }

.day-detail { padding: 14px; margin-top: 12px; }
.dd-head { display: flex; flex-direction: column; margin-bottom: 6px; }
.dd-head span { font-size: .84rem; color: var(--gold-deep); font-weight: 600; }
.dd-ev {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; margin-top: 8px;
  padding: 12px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--bg-elev);
  font: inherit; color: inherit; cursor: pointer; border-left: 4px solid var(--gold);
}
.dd-ev.lv-dai-le { border-left-color: var(--crimson); }
.dd-ev.lv-via, .dd-ev.lv-ky-niem { border-left-color: var(--azure); }
.dd-ev span { font-size: .86rem; color: var(--text-soft); }
.dd-ev .dd-src { display: inline-flex; align-items: center; gap: 4px; color: var(--azure); font-weight: 700; font-size: .78rem; }
.dd-src svg { width: 14px; height: 14px; }
.dd-none { color: var(--text-faint); font-size: .88rem; margin: 6px 0 0; }

.up-row, .yr-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left;
  border: 0; background: none; font: inherit; color: inherit; cursor: pointer;
}
.up-row + .up-row, .yr-row + .yr-row { border-top: 1px solid var(--card-border); }
.up-date {
  flex: 0 0 46px; height: 50px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold-deep);
}
.up-row.lv-dai-le .up-date { background: color-mix(in srgb, var(--crimson) 16%, var(--card)); color: var(--crimson); }
.up-row.lv-via .up-date, .up-row.lv-ky-niem .up-date { background: color-mix(in srgb, var(--azure) 14%, var(--card)); color: var(--azure); }
.up-date b { font-size: 1.2rem; line-height: 1; }
.up-date span { font-size: .68rem; font-weight: 700; }
.up-main, .yr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.up-main b, .yr-main b { font-size: .95rem; }
.up-main span, .yr-main span { font-size: .8rem; color: var(--text-soft); }
.up-in { flex: 0 0 auto; font-size: .76rem; font-weight: 800; color: var(--gold-deep); text-align: right; }
.year-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.year-head .section-title { margin-bottom: 10px; }
.year-nav { display: flex; }
.yr-lunar { flex: 0 0 92px; font-size: .8rem; font-weight: 800; color: var(--gold-deep); }
.yr-row.lv-dai-le .yr-lunar { color: var(--crimson); }
.yr-row.past { opacity: .5; }
.source-quote { margin: 6px 4px 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border-left: 3px solid var(--gold); }
.sq-label { display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 800; color: var(--gold-deep); }
.sq-label svg { width: 15px; height: 15px; flex: 0 0 auto; }
.source-quote blockquote { margin: 6px 0 0; font-family: var(--font-read); font-size: 1rem; line-height: 1.55; }

/* ---------- Từ điển ---------- */
.dict-entry .de-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 4px 2px; }
.dict-entry .de-head b { font-size: 1.25rem; font-family: var(--font-read); }
.de-han { font-size: 1.1rem; color: var(--gold-deep); }
.de-trans { font-size: .82rem; color: var(--text-faint); font-style: italic; margin: 4px 4px 8px; }
.de-body { font-family: var(--font-read); font-size: calc(1.02rem * var(--read-scale)); line-height: 1.6; padding: 0 4px; }
.de-body p { margin: 0 0 8px; text-align: justify; }
.de-body h4 { margin: 12px 0 6px; font-family: var(--font-ui); font-size: .86rem; color: var(--gold-deep); }
.de-more { color: var(--text-faint); }
.de-src { font-size: .74rem; color: var(--text-faint); margin: 8px 4px 0; }
.dict-sug { margin-top: 10px; }
.term-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.term-row b { font-weight: 600; font-family: var(--font-read); font-size: 1.02rem; }

/* ---------- Nghe kinh ---------- */
.verse-block.speaking {
  background: color-mix(in srgb, var(--azure) 15%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--azure) 35%, transparent);
}
.audio-bar {
  position: fixed; left: 8px; right: 8px; z-index: 120;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px;
  background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
  border: 1px solid var(--card-border); border-radius: 18px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ab-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ab-info b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-info span { font-size: .74rem; color: var(--text-soft); }
.ab-ctl { display: flex; align-items: center; gap: 2px; }
.ab-ctl button {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--text);
  display: grid; place-items: center; cursor: pointer; font: inherit; font-weight: 800; font-size: .78rem;
}
.ab-ctl .ab-main { width: 46px; height: 46px; background: var(--gold); color: #fff; }
.ab-ctl .ab-rate { width: auto; padding: 0 6px; }
body.has-audio .view { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 100px); }
body.has-audio #toast { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 90px); }

/* ---------- Tạo ảnh ---------- */
.img-preview { display: flex; justify-content: center; padding: 4px 0 10px; }
.img-preview canvas { max-width: 100%; max-height: 46vh; width: auto; height: auto; border-radius: 10px; box-shadow: var(--shadow); }
.img-opts { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.img-opts .segmented.compact { max-width: none; }
.img-bgs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.img-bg { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--card-border); cursor: pointer; }
.img-bg.on { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent); }

/* ---------- Cá nhân ---------- */
.me-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.me-tiles .tile { text-decoration: none; color: inherit; padding: 12px 4px; }
.me-tiles .tile-num { font-size: 1.4rem; }
.me-foot { text-align: center; color: var(--text-faint); font-size: .8rem; margin: 20px 0 0; line-height: 1.6; }
.hist-row { display: flex; align-items: center; gap: 12px; }
.hist-ic { color: var(--gold-deep); flex: 0 0 auto; }
.hist-row b { display: block; font-size: .95rem; }
.hist-row span { font-size: .8rem; color: var(--text-soft); }
.hist-row time { font-size: .76rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.arch-card { padding: 16px; margin-bottom: 10px; }
.arch-date { font-size: .76rem; font-weight: 800; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.arch-verse { font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.5; white-space: pre-line; margin-bottom: 6px; }
.off-row .ok { color: #2e7d32; font-weight: 700; }
:root[data-theme="dark"] .off-row .ok { color: #81c784; }
.file-btn { cursor: pointer; }
.invite-card { padding: 20px; text-align: center; }
.inv-logo { border-radius: 18px; box-shadow: var(--shadow); }
.invite-card h2 { margin: 10px 0 4px; }
.qr { width: min(260px, 70vw); margin: 14px auto 8px; padding: 10px; background: #fff; border-radius: 14px; }
.qr svg { display: block; width: 100%; height: auto; }
.inv-url { font-size: .84rem; color: var(--azure); word-break: break-all; font-weight: 600; }
.desc.warn { color: var(--crimson); }

/* ---------- Lời nguyện ---------- */
.prayer-card { padding: 14px 16px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; }
.pc-top .tag { font-size: .72rem; font-weight: 800; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .05em; }
.pc-top time { font-size: .76rem; color: var(--text-faint); }
.prayer-card h3 { margin: 6px 0 2px; font-size: 1rem; }
.pc-text { margin: 4px 0; white-space: pre-line; color: var(--text); font-size: .95rem; line-height: 1.55; }
.pc-meta { font-size: .76rem; color: var(--text-faint); }
.pray-mode {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--gold) 25%, var(--bg)), var(--bg));
  animation: fade .3s ease;
}
.pm-close { align-self: flex-end; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.pm-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; max-width: 560px; margin: 0 auto; gap: 10px; }
.pm-card h2 { font-family: var(--font-serif); font-size: 1.5rem; margin: 6px 0; line-height: 1.35; }
.pm-card p { color: var(--text-soft); font-size: 1.02rem; line-height: 1.6; }
.pm-card .pm-text { font-family: var(--font-read); font-size: 1.25rem; color: var(--text); white-space: pre-line; max-height: 50vh; overflow-y: auto; }
.pm-card .tag { font-size: .78rem; font-weight: 800; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .08em; }
.pm-eye { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }
.pm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.pm-foot span { color: var(--text-faint); font-weight: 700; font-size: .86rem; }
.pm-foot .btn { padding: 12px 26px; font-size: 1rem; }

/* ---------- PDF.js ---------- */
.pdfjs { display: flex; flex-direction: column; }
.pdf-bar {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  border-bottom: 1px solid var(--card-border); background: var(--bg-elev);
}
.pb-btn {
  min-width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  display: grid; place-items: center; cursor: pointer; font: inherit; font-size: 1.2rem; font-weight: 700;
}
.pb-btn:active { background: var(--gold-soft); }
.pb-page { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.pb-page input {
  width: 52px; text-align: center; padding: 5px 4px; border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--card); color: var(--text); font: inherit; font-weight: 700;
}
.pb-sp { flex: 1; }
.pdf-exit2 { display: none; }
.pdf-frame-wrap.fullscreen .pdf-exit2 { display: grid; }
.pdf-scroll { height: 72vh; overflow: auto; -webkit-overflow-scrolling: touch; background: color-mix(in srgb, var(--text) 8%, var(--bg)); }
.pdf-frame-wrap.fullscreen.pdfjs { display: flex; }
.pdf-frame-wrap.fullscreen .pdf-scroll { flex: 1; height: auto; }
.pdf-frame-wrap.fullscreen .pdf-bar { padding-top: calc(6px + var(--safe-top)); }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; min-width: min-content; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); flex: 0 0 auto; }
.pdf-page canvas { display: block; }
.pp-num { position: absolute; inset: 0; display: grid; place-items: center; color: #bbb; font-weight: 700; font-size: 1.4rem; }
.pdf-page.ok .pp-num { display: none; }
.pdf-loading, .pdf-fallback { padding: 40px 16px; text-align: center; color: var(--text-soft); }
.pdf-fallback svg { width: 36px; height: 36px; color: var(--gold-deep); }

@media (max-width: 380px) {
  .sheet-tile { font-size: .7rem; }
  .ct-day { font-size: 3rem; }
  .me-tiles .tile-lbl { font-size: .66rem; }
  .yr-lunar { flex-basis: 78px; }
}

/* ---------------- Trình duyệt cũ (iOS 15, Android WebView cũ…) ----------------
   color-mix() chỉ có từ Safari 16.2 / Chrome 111. Máy cũ bỏ qua cả dòng đó nên
   thanh tiêu đề, thanh dưới, ô tô sáng… bị trong suốt. Cho chúng màu đặc thay thế. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .app-header, .tabbar, .audio-bar { background: var(--bg-elev); }
  .pdf-scroll { background: #e9e4da; }
  .verse-block.target { background: rgba(184, 134, 11, 0.26); box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.45); }
  .verse-block.target.faded { background: rgba(184, 134, 11, 0.10); box-shadow: none; }
  .result-text mark { background: rgba(184, 134, 11, 0.45); }
  .ocr-tag, .mg-cell.ev-via:not(.sel) { background: rgba(42, 111, 151, 0.14); }
  .mg-cell.ev-dl:not(.sel) { background: rgba(178, 58, 72, 0.14); }
  .notice { background: var(--card); border: 1px solid var(--card-border); }
}

/* ---------------- Thông báo chung trên trang Hôm nay ---------------- */
.announce { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 10px 0 4px;
  border-left: 3px solid var(--gold); }
.announce .ann-ic svg { width: 22px; height: 22px; color: var(--gold-deep); }
.announce .ann-main { flex: 1; min-width: 0; }
.announce .ann-main b { display: block; margin-bottom: 2px; }
.announce .ann-main p { margin: 0 0 8px; color: var(--text-soft); font-size: 0.9rem; white-space: pre-line; }
.announce .ann-x { border: 0; background: transparent; color: var(--text-faint); cursor: pointer; padding: 2px; }
.announce .ann-x svg { width: 18px; height: 18px; }

/* ---------------- Quyền riêng tư / Quản trị ---------------- */
.desc-p { margin: 0 0 10px; color: var(--text-soft); font-size: 0.9rem; line-height: 1.55; }
.desc-ul { margin: 0 0 10px; padding-left: 20px; color: var(--text-soft); font-size: 0.9rem; line-height: 1.55; }
.adm-form { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-form .field { flex: 1 1 200px; min-width: 0; font-size: 16px; }
.adm-form.col { flex-direction: column; }
.adm-form.col .field { flex: none; width: 100%; }
.adm-form textarea.field { resize: vertical; font-family: inherit; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 0.88rem; color: var(--text-soft); }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px;
  color: var(--text-soft); font-size: 0.84rem; }
.adm-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .adm-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.adm-tile { padding: 12px; }
.adm-lbl { font-size: 0.76rem; color: var(--text-soft); font-weight: 600; }
.adm-num { font-size: 1.6rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.25; }
.adm-sub { font-size: 0.74rem; color: var(--text-faint); }
.adm-card { padding: 14px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.ch-grid { stroke: var(--card-border); stroke-width: 1; }
.ch-ax { fill: var(--text-faint); font-size: 11px; font-family: var(--font-ui); }
.ch-fill { fill: var(--gold); }
.ch-bar.on .ch-fill { fill: var(--gold-deep); }
.ch-tip { position: absolute; top: 0; padding: 4px 8px; border-radius: 8px; font-size: 0.78rem; pointer-events: none;
  background: var(--text); color: var(--bg); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 0.86rem; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hb-track { height: 10px; border-radius: 5px; background: var(--gold-soft); overflow: hidden; }
.hb-fill { height: 100%; border-radius: 0 5px 5px 0; background: var(--gold); }
.hb-v { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); text-align: right; min-width: 54px; }
.hb-v small { font-weight: 500; color: var(--text-faint); }
.inv-list { display: flex; flex-direction: column; margin-top: 12px; border-top: 1px solid var(--card-border); }
.inv-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inv-code { font-size: 0.78rem; color: var(--azure); word-break: break-all; }
.inv-stat { font-size: 0.78rem; color: var(--text-soft); }
.inv-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.inv-acts .btn svg { width: 16px; height: 16px; }
.pdf-page .pp-err {
  position: absolute; inset: 0; margin: auto; width: 80%; height: 64px; border-radius: 12px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text-soft);
  font: inherit; font-size: 0.86rem; cursor: pointer;
}

/* ---------------- Cúng Tứ Thời (#/tu-thoi) ---------------- */
.tt-hero { padding: 16px; }
.tt-hero h2 { margin: 6px 0 12px; font-size: 1.15rem; }
.tt-kicker { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--gold-deep); }
.tt-kicker svg { width: 16px; height: 16px; }
.tt-hero .thoi-grid { margin-bottom: 10px; }
.tt-hero .thoi small { display: block; }
.tt-src { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; font-size: 0.82rem; color: var(--azure); text-decoration: none; }
.tt-src svg { width: 15px; height: 15px; flex: 0 0 auto; }
.tt-hint { margin: 10px 0 0; font-size: 0.8rem; color: var(--text-soft); text-align: center; }
.tt-list { padding: 4px 0; }
.tt-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-decoration: none; color: inherit; }
.tt-row + .tt-row { border-top: 1px solid var(--card-border); }
.tt-num { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-deep); font-weight: 800; font-size: 0.86rem; }
.tt-num svg { width: 16px; height: 16px; }
.tt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-main small { color: var(--text-soft); font-size: 0.78rem; margin-top: 1px; }
.tt-actions { display: flex; gap: 8px; margin: 12px 0; }
.tt-actions .btn { flex: 1; justify-content: center; }

/* ===========================================================
   v28 — Ngày chay · Chế độ tụng · Học thuộc kinh · Đố vui · Gợi ý cài app
   =========================================================== */
:root { --leaf: #3d8b4f; --leaf-soft: rgba(61, 139, 79, 0.12); }
:root[data-theme="dark"] { --leaf: #7cc48a; --leaf-soft: rgba(124, 196, 138, 0.14); }

/* ---------------- Ngày chay (trai kỳ) ---------------- */
.chay-mark { display: inline-block; width: 8px; height: 8px; background: var(--leaf); border-radius: 0 60% 0 60%; }
.mg-cell .chay-mark { position: absolute; top: 4px; right: 4px; }
.mg-cell.sel .chay-mark { background: #fff; }
.month-legend .chay-leg { display: inline-flex; align-items: center; gap: 4px; }
.month-legend .chay-leg[hidden] { display: none; }
.dd-chay { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--leaf-soft); }
.dd-chay svg { color: var(--leaf); flex: 0 0 auto; }
.dd-chay div { display: flex; flex-direction: column; }
.dd-chay span { font-size: .82rem; color: var(--text-soft); }
.chay-card { padding: 14px 16px; margin-top: 12px; }
.chay-card .thoi-head svg { color: var(--leaf); }
.segmented.compact.chay-seg { max-width: none; margin: 10px 0 2px; }
.chay-desc { font-size: .88rem; color: var(--text-soft); margin: 10px 2px 2px; }
.chay-next { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--leaf-soft); margin-top: 10px; }
.chay-next svg { color: var(--leaf); flex: 0 0 auto; }
.chay-next div { display: flex; flex-direction: column; min-width: 0; }
.chay-next span { font-size: .82rem; color: var(--text-soft); }
.chay-next.now { background: var(--leaf); color: #fff; }
.chay-next.now svg, .chay-next.now span { color: #fff; }
:root[data-theme="dark"] .chay-next.now, :root[data-theme="dark"] .chay-next.now svg, :root[data-theme="dark"] .chay-next.now span { color: #10200f; }
.chay-sub { font-size: .76rem; color: var(--text-faint); font-weight: 700; margin: 12px 2px 6px; text-transform: uppercase; letter-spacing: .04em; }
.chay-days { display: flex; flex-wrap: wrap; gap: 6px; }
.chay-day { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--bg-elev); }
.chay-day b { font-size: 1rem; color: var(--leaf); line-height: 1.2; }
.chay-day small { font-size: .7rem; color: var(--text-soft); white-space: nowrap; }
.chay-day.past { opacity: .45; }
.chay-day.today { border-color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }
.chay-card .check-row { margin-top: 8px; }
.chay-times { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 4px 4px; }
.chay-times label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--text-soft); }
.chay-home { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-top: 12px; text-decoration: none; color: inherit; border-left: 4px solid var(--leaf); }
.chay-home .ch-main { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.chay-home .ch-main svg { color: var(--leaf); flex: 0 0 auto; width: 24px; height: 24px; }
.chay-home .ch-main div { display: flex; flex-direction: column; min-width: 0; }
.chay-home .ch-main span { font-size: .82rem; color: var(--text-soft); }
.chay-home.now { background: var(--leaf-soft); }
.ch-x, .it-x { border: 0; background: none; color: var(--text-faint); padding: 6px; cursor: pointer; flex: 0 0 auto; display: grid; place-items: center; }

/* ---------------- Gợi ý cài app ---------------- */
.install-tip { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; margin-bottom: 12px; border-left: 4px solid var(--gold); }
.install-tip > svg { color: var(--gold-deep); flex: 0 0 auto; width: 22px; height: 22px; }
.install-tip > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-tip span { font-size: .8rem; color: var(--text-soft); }
.install-tip .btn { padding: 8px 14px; flex: 0 0 auto; }

/* ---------------- Nút trong trang đọc ---------------- */
.reader-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 12px; }
.reader-tools .rt-chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--gold-deep); font-weight: 700; font-size: .84rem; }
.reader-tools .rt-chip svg { width: 16px; height: 16px; }

/* ---------------- Chế độ tụng kinh ---------------- */
body.chant-on { overflow: hidden; }
body.chant-on .app-header, body.chant-on .tabbar { visibility: hidden; }
.chant { position: fixed; inset: 0; z-index: 150; background: var(--bg); color: var(--text); --chant-scale: 1.1; }
.chant-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.chant-body { max-width: 760px; margin: 0 auto; padding: calc(var(--safe-top) + 74px) 12px 45vh;
  font-family: var(--font-read); font-size: calc(15pt * var(--chant-scale)); line-height: 1.6; }
.chant-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-top) + 6px) 8px 8px; background: var(--bg-elev); border-bottom: 1px solid var(--card-border);
  transition: transform .25s ease, opacity .25s ease; }
.chant-prog { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 62px); z-index: 2; height: 3px; background: transparent; transition: opacity .25s; }
.chant-prog i { display: block; height: 100%; width: 0; background: var(--gold); }
.ch-title { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.ch-btn { min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); font-family: inherit; font-weight: 800; font-size: .95rem; cursor: pointer; display: grid; place-items: center; }
.ch-btn svg { width: 18px; height: 18px; }
.ch-wake { color: var(--text-faint); }
.ch-wake.on { color: var(--gold-deep); border-color: var(--gold); }
.chant-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 12px calc(var(--safe-bottom) + 10px); background: var(--bg-elev); border-top: 1px solid var(--card-border);
  transition: transform .25s ease, opacity .25s ease; }
.ch-play { width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff; }
:root[data-theme="dark"] .ch-play { color: #1a1408; }
.ch-speed { min-width: 92px; font-size: .82rem; color: var(--text-soft); font-weight: 600; }
.chant.bars-off .chant-top { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.chant.bars-off .chant-prog { opacity: 0; }
.chant.bars-off .chant-bottom { transform: translateY(100%); opacity: 0; pointer-events: none; }
.chant-intro { font-family: var(--font-ui); font-size: .55em; color: var(--text-soft); text-align: center; margin: 0 0 1.4em; line-height: 1.5; }
.chant-sec { margin-bottom: 1.8em; }
.chant-sec h2 { font-family: var(--font-ui); font-size: .78em; color: var(--gold-deep); text-align: center; margin: .4em 0 .2em; }
.cs-num { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--gold-soft); margin-right: .45em; font-size: .85em; vertical-align: middle; }
.cs-sub { text-align: center; font-family: var(--font-ui); font-size: .52em; color: var(--text-faint); margin: 0 0 .9em; }
.cv { margin: 0 0 .15em; }
.cv-l { text-align: center; text-wrap: balance; }
.cv-p { text-align: justify; margin-bottom: .55em; }
.cv-c { text-align: center; font-style: italic; color: var(--text-soft); font-size: .7em; margin: .5em 0; }
.cv-n { font-family: var(--font-ui); font-size: .55em; line-height: 1.5; color: var(--text-soft); border-left: 2px solid var(--card-border); padding-left: 10px; margin: .7em 0; }
.cv-h { font-family: var(--font-ui); font-weight: 700; color: var(--gold-deep); font-size: .68em; text-align: center; margin-top: 1em; }
.chant-end { display: flex; flex-direction: column; gap: 10px; align-items: center; font-family: var(--font-ui); font-size: 1rem; margin-top: 2em; }
.chant-end p { color: var(--text-soft); margin: 0; }

/* ---------------- Học thuộc kinh ---------------- */
.memo-hero { padding: 14px 16px; }
.mh-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.mh-top svg { color: var(--gold-deep); width: 26px; height: 26px; flex: 0 0 auto; }
.mh-top div { display: flex; flex-direction: column; }
.mh-top span { font-size: .84rem; color: var(--text-soft); }
.memo-tag { font-size: .72rem; font-weight: 700; color: var(--gold-deep); background: var(--gold-soft); padding: 3px 8px; border-radius: 999px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.memo-tag.ok { color: #fff; background: var(--leaf); }
:root[data-theme="dark"] .memo-tag.ok { color: #10200f; }
.memo-tag svg { width: 12px; height: 12px; }
.memo-head { text-align: center; }
.segmented.compact.memo-levels { max-width: none; margin: 6px 0 2px; }
.memo-hint { font-size: .82rem; color: var(--text-soft); text-align: center; margin: 8px 4px 10px; }
.memo-text { padding: 16px 14px; font-family: var(--font-read); font-size: calc(14pt * var(--read-scale)); line-height: 1.8; text-align: center; }
.ml { margin: 0 0 .15em; }
.ml-note { font-family: var(--font-ui); font-size: .72em; font-style: italic; color: var(--text-soft); margin: .6em 0; }
.mw { font: inherit; line-height: inherit; color: inherit; background: none; border: 0; border-bottom: 2px solid var(--gold); border-radius: 0; padding: 0 1px; margin: 0; cursor: pointer; }
.mw .mw-r { color: transparent; }
.mw.shown { border-bottom-color: transparent; }
.mw.shown .mw-r { color: var(--gold-deep); }
.ml-hide { font: inherit; line-height: inherit; border: 0; cursor: pointer; background: var(--gold-soft); border-radius: 8px; padding: 0 6px; color: transparent; }
.ml-hide.shown { background: none; color: var(--gold-deep); }
.memo-actions { display: flex; gap: 8px; margin-top: 10px; }
.memo-actions .btn { flex: 1; justify-content: center; }
.mq-prog { font-size: .8rem; color: var(--text-faint); text-align: center; margin: 4px 0 10px; font-weight: 700; }
.mq-ctx { text-align: center; color: var(--text-faint); font-family: var(--font-read); margin: 0; }
.mq-line { text-align: center; font-family: var(--font-read); font-size: 1.12rem; font-weight: 700; margin: 4px 0; }
.mq-ask { text-align: center; font-size: .84rem; color: var(--text-soft); margin: 10px 0 8px; }
.mq-opts, .qz-opts { display: flex; flex-direction: column; gap: 8px; }
.mq-opt, .qz-opt { font: inherit; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card); color: var(--text); cursor: pointer; line-height: 1.45; }
.mq-opt { font-family: var(--font-read); font-size: 1.02rem; text-align: center; }
.mq-opt.ok, .qz-opt.ok { border-color: var(--leaf); background: var(--leaf-soft); }
.mq-opt.bad, .qz-opt.bad { border-color: var(--crimson); background: rgba(178, 58, 72, 0.1); }
.answered .mq-opt:not(.ok):not(.bad), .answered .qz-opt:not(.ok):not(.bad) { opacity: .55; }
.mq-result { text-align: center; }
.mq-score, .qs-score { font-size: 2.6rem; font-weight: 800; color: var(--gold-deep); line-height: 1.2; }
.qs-score small { font-size: 1.2rem; color: var(--text-faint); }

/* ---------------- Ngũ Giới Cấm & Tứ Đại Điều Qui (màn Hôm nay) ---------------- */
.gl-card { padding: 14px 16px 16px; }
.segmented.compact.gl-seg { max-width: none; margin: 0 0 12px; }
.gl-intro { margin: 0 0 10px; font-family: var(--font-read); font-size: .98rem; color: var(--text-soft); }
.gl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.gl-list li { display: flex; gap: 10px; align-items: flex-start; }
.gl-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; margin-top: 2px;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  background: var(--gold-soft); color: var(--gold-deep);
}
.gl-item { flex: 1; min-width: 0; }
.gl-name { display: block; font-size: .9rem; letter-spacing: .03em; color: var(--gold-deep); }
.gl-txt { margin: 2px 0 0; font-family: var(--font-read); font-size: 1rem; line-height: 1.55; }
.gl-card.collapsed .gl-txt {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.gl-card.collapsed .gl-txt + .gl-txt { display: none; }
.gl-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.gl-foot .btn { padding: 7px 12px; font-size: .84rem; }

/* ---------------- Từ ngữ hôm nay & Đố vui ---------------- */
.word-card { padding: 16px; }
.wc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wc-term { font-size: 1.25rem; font-family: var(--font-read); }
.wc-han { font-size: 1.05rem; color: var(--text-faint); }
.wc-def { margin: 8px 0 12px; font-family: var(--font-read); font-size: 1.02rem; line-height: 1.55; }
.wc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wc-src { margin: 10px 0 0; font-size: .74rem; color: var(--text-faint); }
.quiz-start { padding: 22px 18px; text-align: center; }
.qs-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--gold-soft); color: var(--gold-deep); display: grid; place-items: center; margin: 0 auto 6px; }
.qs-icon svg { width: 30px; height: 30px; }
.quiz-start h2 { margin: 6px 0; }
.quiz-start p { color: var(--text-soft); font-size: .92rem; }
.qs-stats { display: flex; gap: 8px; margin: 14px 0; }
.qs-stats div { flex: 1; display: flex; flex-direction: column; padding: 10px 4px; border-radius: 12px; background: var(--bg); }
.qs-stats b { font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.qs-stats b svg { color: var(--crimson); width: 16px; height: 16px; }
.qs-stats span { font-size: .72rem; color: var(--text-soft); }
.qz-top { display: flex; justify-content: space-between; font-size: .84rem; font-weight: 700; color: var(--text-soft); margin: 2px 4px 8px; }
.qz-card { padding: 18px 16px; margin: 14px 0; text-align: center; }
.qz-kind { margin: 0; font-size: .78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.qz-term { font-size: 1.5rem; font-weight: 700; font-family: var(--font-read); margin: 6px 0 0; }
.qz-term span { font-size: 1rem; color: var(--text-faint); font-weight: 400; }
.qz-def { font-family: var(--font-read); font-size: 1.08rem; margin: 8px 0 0; line-height: 1.5; }
.qz-opt { font-size: .94rem; }
.qz-after { margin-top: 12px; padding: 12px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.qz-after.ok { background: var(--leaf-soft); }
.qz-after.bad { background: rgba(178, 58, 72, 0.1); }
.qz-after > span { font-size: .88rem; color: var(--text-soft); }
.qz-after-actions { display: flex; gap: 8px; margin-top: 4px; }
.qz-after-actions .btn { flex: 1; justify-content: center; }
.result-row.qz-review { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.qz-review span { font-size: .84rem; color: var(--text-soft); }

/* Đang mở bản chạy trên máy tính — nhắc địa chỉ trên mạng để gửi người khác */
.local-tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 12px; border-left: 4px solid var(--azure); }
.local-tip > svg { color: var(--azure); flex: 0 0 auto; margin-top: 2px; }
.local-tip > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.local-tip span { font-size: .82rem; color: var(--text-soft); }
.local-tip code { font-size: .95rem; font-weight: 700; color: var(--text); word-break: break-all; }
.lt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.lt-actions .btn { padding: 7px 12px; font-size: .84rem; }
.quick-kinh { margin-bottom: 14px; }
.quick-kinh .chip { text-decoration: none; color: var(--text); font-weight: 600; }
.quick-kinh .chip:last-child { color: var(--gold-deep); }

/* ---------------- Tra cứu Kinh Dịch (js/feat-kinhdich.js) ---------------- */
.kd-hero { padding: 16px 16px 14px; }
.kd-hero h2 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 1.35rem; }
.kd-hero p { margin: 0 0 12px; color: var(--text-soft); font-size: .92rem; line-height: 1.5; }
.kd-search { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--card-border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 1rem; }
.kd-hits { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.kd-hits a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px;
  text-decoration: none; color: var(--text); background: var(--bg); border: 1px solid var(--card-border); }
.kd-hex { width: 44px; height: auto; color: var(--text); flex: 0 0 auto; }
.kd-hex.sm { width: 30px; }
.kd-hex.big { width: 76px; }
.kd-tri { width: 46px; height: auto; color: var(--gold-deep); }
.kd-tri.big { width: 76px; }
.kd-tip { color: var(--text-soft); font-size: .88rem; line-height: 1.5; margin: 4px 2px 10px; }
.kd-progress { color: var(--text-soft); font-size: .86rem; line-height: 1.5; margin: 12px 4px 0; }
.han { font-family: "Noto Serif CJK TC", "Noto Serif TC", "PMingLiU", "MingLiU", serif; font-weight: 400; color: var(--text-soft); }

.kd-build { padding: 14px; }
.kd-build-row { display: flex; gap: 14px; align-items: center; }
.kd-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kd-lrow { display: flex; align-items: center; gap: 8px; }
.kd-lrow small { color: var(--text-faint); font-size: .74rem; min-width: 64px; }
.kd-line { flex: 1; max-width: 150px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: flex; gap: 14px; align-items: stretch; }
.kd-line span { flex: 1; border-radius: 3px; background: var(--text); }
.kd-line.yang span + span { display: none; }
.kd-line.mv span { background: var(--crimson); }
.kd-mv { border: 1px solid var(--card-border); background: var(--bg); color: var(--text-soft); border-radius: 999px;
  font: inherit; font-size: .74rem; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.kd-mv.on { color: var(--crimson); border-color: var(--crimson); }
.kd-pick { flex: 0 0 auto; }
.kd-trisel { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.kd-trisel label { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--text-soft); }
.kd-trisel select { padding: 8px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--bg); color: var(--text); font: inherit; }
.kd-out { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.kd-result { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px; border-radius: 12px;
  background: var(--gold-soft); color: var(--text); text-decoration: none; }
.kd-result .no { font-size: .74rem; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .05em; width: 100%; }
.kd-result b { font-family: var(--font-serif); font-size: 1.12rem; }
.kd-result .go { margin-left: auto; color: var(--gold-deep); font-weight: 700; font-size: .88rem; }
.kd-result.bien { background: var(--bg); border: 1px solid var(--card-border); }
.kd-dong { display: flex; gap: 6px; flex-wrap: wrap; }
.kd-dong .chip { text-decoration: none; color: var(--crimson); }

.kd-tri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kd-tri-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; text-decoration: none; color: var(--text); text-align: center; }
.kd-tri-card b { font-size: .95rem; }
.kd-tri-card > span { font-size: .78rem; color: var(--text-soft); }
.kd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kd-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px;
  text-decoration: none; color: var(--text); text-align: center; }
.kd-tile .no { position: absolute; top: 4px; left: 7px; font-size: .68rem; color: var(--text-faint); font-weight: 700; }
.kd-tile b { font-size: .86rem; line-height: 1.2; }
.kd-tile .han { font-size: .8rem; }
.kd-tile.has { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
@media (min-width: 560px) { .kd-grid { grid-template-columns: repeat(6, 1fr); } }

.kd-head { padding: 16px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.kd-head-meta { flex: 1; min-width: 180px; }
.kd-head-meta .no { font-size: .76rem; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .06em; }
.kd-head-meta h2 { margin: 2px 0 6px; font-family: var(--font-serif); font-size: 1.4rem; }
.kd-head-meta p { margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.6; }
.kd-head-meta a { color: var(--gold-deep); font-weight: 600; text-decoration: none; }
.kd-nav { width: 100%; display: flex; gap: 8px; justify-content: space-between; }
.kd-nav .btn { text-decoration: none; }
.kd-dongbox { padding: 12px 14px; margin-top: 10px; line-height: 1.6; border-color: var(--crimson); }
.kd-dongbox a { color: var(--crimson); font-weight: 700; }
.kd-jump { margin-top: 12px; }
.kd-src { color: var(--text-faint); font-size: .8rem; margin: 4px 4px 8px; }
.kd-sec { margin-top: 10px; overflow: hidden; }
.kd-sec summary { list-style: none; cursor: pointer; padding: 13px 34px 13px 14px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.kd-sec summary::-webkit-details-marker { display: none; }
.kd-sec summary::after { content: "›"; position: absolute; right: 16px; top: 12px; color: var(--text-faint); font-size: 1.2rem; transition: transform .2s; }
.kd-sec[open] summary::after { transform: rotate(90deg); }
.kd-sec[open] summary { border-bottom: 1px solid var(--card-border); }
.kd-sec-t { font-weight: 700; color: var(--gold-deep); }
.kd-sec-s { font-family: var(--font-read); font-style: italic; font-size: 1.02rem; color: var(--text); }
.kd-sec.dong { border-color: var(--crimson); }
.kd-sec.dong .kd-sec-t { color: var(--crimson); }
.kd-body { padding: 6px 16px 14px; font-family: var(--font-read); font-size: calc(1.06rem * var(--read-scale)); line-height: 1.6; text-align: justify; }
.kd-body p { margin: 0 0 8px; }
.kd-body .kd-h { font-family: var(--font-ui); font-size: .92rem; color: var(--gold-deep); margin: 12px 0 6px; text-align: left; }
.kd-body .kd-kinh { font-style: italic; text-align: left; padding: 4px 0 4px 10px; border-left: 3px solid var(--gold); }
.kd-body .kd-kinh.k { font-style: normal; font-weight: 700; }
.kd-body .kd-v { margin: 0; font-style: italic; text-align: left; padding-left: 10px; }
.kd-body .kd-note { font-size: .86em; color: var(--text-soft); }
.kd-read { display: inline-block; margin-top: 6px; font-family: var(--font-ui); font-size: .84rem; font-weight: 600;
  color: var(--gold-deep); text-decoration: none; }
.kd-wait { padding: 14px; margin-top: 12px; line-height: 1.5; }
.kd-wait p { margin: 6px 0 0; color: var(--text-soft); font-size: .9rem; }

/* ---------------- Lưu cài đặt trên mạng (#/sync) · cảnh báo ---------------- */
.notice.warn { background: color-mix(in srgb, var(--crimson) 10%, var(--card)); border-color: color-mix(in srgb, var(--crimson) 35%, var(--card-border)); }
.notice.warn svg { color: var(--crimson); }
.sheet-desc.warn { color: var(--crimson); }
.sync-card { padding: 16px; }
.sync-card .desc-p:last-child { margin-bottom: 0; }
.sy-status { display: flex; gap: 10px; align-items: flex-start; }
.sy-status > svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--gold-deep); margin-top: 1px; }
.sy-status > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sy-status span { font-size: .86rem; color: var(--text-soft); }
.sy-ok { color: #2e7d4f !important; }
[data-theme="dark"] .sy-ok { color: #7fd1a0 !important; }
.sy-bad { color: var(--crimson) !important; }
.sy-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; font-size: 1.55rem; font-weight: 700;
  letter-spacing: .08em; text-align: center; padding: 14px 8px; border-radius: 12px; user-select: all; -webkit-user-select: all;
  background: var(--bg-elev); border: 1px dashed var(--gold); color: var(--text); word-break: break-all; }
.sy-actions { margin-top: 12px; }
.sy-form { display: flex; gap: 8px; align-items: center; }
.sy-form .field { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; text-transform: uppercase; letter-spacing: .06em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.sy-form .btn { flex: 0 0 auto; }
.sy-or { text-align: center; margin: 12px 0 8px !important; font-size: .84rem !important; }
#syMsg { margin: 10px 0 0; }
#syMsg:empty { display: none; }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .notice.warn { background: var(--card); border-color: var(--crimson); }
}

/* Liên kết đối chiếu bản PDF gốc ở cuối bài (sách chuyển tự động từ PDF) */
.reader-src { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px auto 0; width: fit-content;
  color: var(--gold-deep); font-family: var(--font-ui); font-size: .86rem; font-weight: 600; text-decoration: none; }
.reader-src svg { width: 16px; height: 16px; }

/* Chuyển nhà sang tên miền riêng (js/feat-move.js) */
.mv-steps { margin: 12px 0 0; padding-left: 1.3em; line-height: 1.6; font-size: .92rem; }
.mv-steps li { margin-bottom: 6px; }
.mv-steps svg { width: 16px; height: 16px; vertical-align: -3px; }
