@charset "UTF-8";
/* ==========================================================================
   Giờ Lễ Việt, bản 3.1: phần thêm trên nền v3.css.
   Cùng màu, cùng chữ, cùng quy ước "đang chọn = nền mực đậm" của bản 3.
   Chỉ thêm các thành phần mới cho hai cửa tìm và các trang địa phương.
   ========================================================================== */

/* thuộc tính hidden luôn thắng các lớp có display riêng */
[hidden] { display: none !important; }

/* ----------------------------------------------------------- khung trang */
.v31-page {
  padding: 18px 0 clamp(56px, 7vw, 96px);
  background: linear-gradient(180deg, var(--sky-1) 0, var(--sky-0) 220px, var(--ground) 420px);
}
.v31-head { margin: 4px 0 22px; }
.v31-head h1 {
  font-size: clamp(2.1rem, 1.35rem + 2.6vw, 3.4rem); font-stretch: 110%; font-weight: 750;
  letter-spacing: -.034em; line-height: 1.12; margin: 0 0 10px;
}
.v31-head p { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 1.06rem; line-height: 1.6; }
.v31-kind {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; vertical-align: 2px;
  background: var(--season-tint); color: var(--season-ink); font-size: .72rem; font-weight: 640;
  font-style: normal; letter-spacing: 0; white-space: nowrap;
}
.v31-none { font-size: .8rem; color: var(--muted-2); }
.v31-more { font-size: .78rem; font-weight: 640; color: var(--muted); align-self: center; }

/* ------------------------------------------------------- bảng điều kiện */
.v31-panel {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 24px;
  padding: 8px clamp(16px, 2.2vw, 28px); box-shadow: var(--sh-card);
}
.v31-prow { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 18px 0; }
.v31-prow + .v31-prow { border-top: 1px solid var(--line-2); }
.v31-plabel { padding-top: 10px; font-weight: 660; font-size: .95rem; color: var(--ink); }
.v31-pctl { min-width: 0; }
.v31-area { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.v31-area .sel { width: auto; min-width: 250px; min-height: 46px; font-weight: 600; font-size: 1rem; background-color: #fff; }
.v31-near { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.v31-near-l { font-size: .88rem; color: var(--muted); }
.v31-near-s { font-size: .85rem; color: var(--muted); }
.v31-near-s .link-u { font-size: inherit; }

.v31-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; cursor: pointer; font-size: .95rem; }
.v31-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.v31-check small { display: block; font-size: .8rem; color: var(--muted); }
.v31-check-sm { margin: 0; align-items: center; font-size: .88rem; color: var(--ink-2); }
.v31-check-sm input { margin: 0; }

/* bảy ô ngày, bản gọn */
.v3 .v31-days-sm .day { min-height: 66px; padding: 6px 4px; border-radius: 14px; }
.v3 .v31-days-sm .day-n { font-size: 1.28rem; }
.v3 .v31-days-sm .day-w { font-size: .76rem; }
.v3 .v31-days .day.on { border-radius: 14px; }

/* ô chọn: buổi, bán kính, loại nhà thờ */
.v31-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.v31-slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.v31-chip {
  position: relative; display: inline-grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center;
  min-height: 48px; padding: 6px 12px 6px 14px; border-radius: 14px; text-align: left;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .16s var(--ease-out);
}
.v31-chip:active { transform: scale(.97); }
.v31-chip-l { grid-column: 1; font-weight: 640; font-size: .92rem; line-height: 1.25; white-space: nowrap; }
.v31-chip-s { grid-column: 1; font-size: .74rem; color: var(--muted); line-height: 1.25; white-space: nowrap; }
.v31-chip-n {
  grid-column: 2; grid-row: 1 / span 2; min-width: 2.2em; padding: 2px 7px; border-radius: 8px; text-align: center;
  background: var(--sheet-2); font-size: .8rem; font-weight: 660; color: var(--ink-2);
}
.v31-chip-n.zero { color: var(--muted-2); }
.v31-chip-ic { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; color: var(--muted); transition: transform .25s var(--ease-out); }
.v31-chip-h[aria-expanded="true"] .v31-chip-ic { transform: rotate(180deg); }
.v31-chip.on, .v31-chip[aria-checked="true"], .v31-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.v31-chip.on .v31-chip-s, .v31-chip[aria-checked="true"] .v31-chip-s { color: rgba(255,255,255,.72); }
.v31-chip.on .v31-chip-n, .v31-chip[aria-checked="true"] .v31-chip-n { background: rgba(255,255,255,.16); color: #fff; }
.v31-chip.on .v31-chip-ic { color: #fff; }
.v31-chip-sm { display: inline-flex; gap: 6px; min-height: 40px; padding: 6px 13px; border-radius: 999px; font-size: .88rem; font-weight: 600; }
.v31-chip-sm[aria-pressed="true"] .muted, .v31-chip-sm.on .muted { color: rgba(255,255,255,.7); }
@media (hover: hover) and (pointer: fine) {
  .v31-chip:not(.on):not([aria-checked="true"]):not([aria-pressed="true"]):hover { border-color: var(--ink-2); }
}

/* mốc giờ cụ thể */
.v31-hours { margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--sheet-2); border: 1px solid var(--line-2); }
.v31-hours-g { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: start; }
.v31-hours-g + .v31-hours-g { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.v31-hours-l { padding-top: 7px; font-size: .82rem; font-weight: 640; color: var(--ink-2); }
.v31-hours-c { display: flex; flex-wrap: wrap; gap: 6px; }
.v31-hr {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 5px 10px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line); font-weight: 660; font-size: .9rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.v31-hr small { font-size: .72rem; font-weight: 560; color: var(--muted); }
.v31-hr.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.v31-hr.on small { color: rgba(255,255,255,.7); }
.v31-hours-f { margin: 12px 0 0; font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------- dải nhịp lễ */
.v31-rib { position: relative; }
.v31-rib-plot { position: relative; height: 70px; }
.v31-rib-axis span.h1 { display: none; }
.v31-rib-bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.v31-rib-b {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; padding: 0; border-radius: 3px;
  cursor: pointer; transition: background-color .15s ease;
}
.v31-rib-b i {
  display: block; width: 100%; height: 100%; border-radius: 3px 3px 1px 1px; background: var(--sky-2);
  transform-origin: 50% 100%; transform: scaleY(var(--h, 0));
  transition: transform .55s var(--ease-out), background-color .2s ease;
  transition-delay: calc(var(--i, 0) * 6ms), 0s;
}
.v31-rib-b.zero { cursor: default; }
.v31-rib-b.zero i { transform: scaleY(.03); background: var(--line); }
.v31-rib-b.past i { background: var(--line); }
.v31-rib-b.on i { background: var(--ink); }
.v31-rib-b.on.past i { background: var(--muted-2); }
@media (hover: hover) and (pointer: fine) {
  .v31-rib-b:not(.zero):hover i { background: var(--season); }
  .v31-rib-b.on:hover i { background: var(--ink); }
}
.v31-rib-b:focus-visible { outline: 2px solid var(--sky-ink); outline-offset: 1px; }
.v31-rib-now { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1.5px solid var(--live); pointer-events: none; }
.v31-rib-now i { position: absolute; top: -4px; left: -4.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px var(--live-tint); }
.v31-rib-axis { position: relative; height: 22px; border-top: 1px solid var(--line); }
.v31-rib-axis span {
  position: absolute; top: 5px; transform: translateX(-50%); font-size: .72rem; color: var(--muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.v31-rib-tip {
  position: absolute; bottom: calc(100% - 14px); transform: translateX(-50%); padding: 5px 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: .78rem; font-weight: 600; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.v31-rib-tip.on { opacity: 1; }

/* ------------------------------------------------------- thêm điều kiện */
.v31-extra { border-top: 1px solid var(--line-2); }
.v31-extra summary {
  display: flex; align-items: center; gap: 10px; padding: 16px 0; cursor: pointer; list-style: none;
  font-weight: 640; color: var(--ink-2);
}
.v31-extra summary::-webkit-details-marker { display: none; }
.v31-extra summary .ic { width: 16px; height: 16px; color: var(--muted); transition: transform .25s var(--ease-out); }
.v31-extra[open] summary .ic { transform: rotate(180deg); }
.v31-extra-n { padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .74rem; }
.v31-extra-n:empty { display: none; }
.v31-extra-b { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; padding: 0 0 20px; }
.v31-f { display: block; min-width: 0; }
.v31-f > span { display: block; margin: 0 0 6px 2px; font-size: .82rem; font-weight: 620; color: var(--muted); }
.v31-f .sel, .v31-f .inp { width: 100%; min-height: 44px; background-color: #fff; }
.v31-f-wide { grid-column: 1 / -1; }

/* ---------------------------------------------- thanh tóm tắt dính ở đầu */
.v31-sum {
  position: fixed; z-index: 55; top: calc(var(--hdr-h) + 10px); left: 50%; width: min(760px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 7px 7px 7px 18px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 2px rgba(12,30,51,.08), 0 14px 30px -16px rgba(12,30,51,.4);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .3s var(--ease-out);
}
.v31-sum.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.v31-sum-t { flex: 1 1 auto; min-width: 0; font-size: .88rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v31-sum-t b { color: var(--ink); }

/* ------------------------------------------------------------ kết quả */
.v31-res { margin-top: 30px; }
.v31-res-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.v31-res-n { font-size: 1.12rem; color: var(--ink); line-height: 1.4; }
.v31-res-n b { font-weight: 720; }
.v31-res-ctx { display: block; font-size: .9rem; color: var(--muted); }
.v31-res-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.v31-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.v31-seg button { min-height: 36px; padding: 5px 14px; border-radius: 999px; font-size: .88rem; font-weight: 620; color: var(--ink-2); transition: background-color .2s ease, color .2s ease; }
.v31-seg button.on { background: var(--ink); color: #fff; }
.v31-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.v31-active:empty { display: none; }
.v31-active .link-u { font-size: .86rem; }
.v31-fade { animation: v31-fade .26s ease both; }
@keyframes v31-fade { from { opacity: .35; } }

/* thời khoá biểu: mỗi dòng một thánh lễ */
.v31-mrs { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.v31-mr {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 11px 20px; border-top: 1px solid var(--line); transition: background-color .15s ease;
}
.v31-mr:first-child, .v31-mr-h + .v31-mr { border-top: 0; }
.v31-mr.same { border-top: 1px solid var(--line-2); }
.v31-mr.same .v31-mr-t { visibility: hidden; }
@media (hover: hover) and (pointer: fine) { .v31-mr:hover { background: var(--sky-0); } .v31-mr:hover b { color: var(--season-ink); } }
.v31-mr-t { font-size: 1.32rem; font-weight: 720; font-stretch: 104%; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.v31-mr-c { min-width: 0; }
.v31-mr-c b { display: block; font-size: 1rem; font-weight: 650; line-height: 1.35; transition: color .15s ease; }
.v31-mr-c small { display: block; font-size: .82rem; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v31-mr-d { text-align: right; font-weight: 650; font-size: .92rem; white-space: nowrap; }
.v31-mr-d small { display: block; font-size: .74rem; font-weight: 450; color: var(--muted); }
.v31-mr-x { font-size: .76rem; font-weight: 620; color: var(--muted-2); white-space: nowrap; }
.v31-mr.past .v31-mr-t, .v31-mr.past b { color: var(--muted-2); }
.v31-mr.vig .v31-mr-t { color: var(--season-ink); }
.v31-mr-h {
  padding: 10px 20px; background: var(--sheet-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2);
  font-size: .82rem; font-weight: 680; color: var(--ink-2);
}
.v31-mr-h:first-child { border-top: 0; }
.v31-more-w { display: flex; justify-content: center; margin-top: 18px; }
.v31-more-w .btn .muted { font-weight: 450; margin-left: 2px; }
.v31-more-end { margin-top: 14px; text-align: center; font-size: .84rem; color: var(--muted); }
.v31-empty { background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.v31-empty h3 { max-width: 42ch; margin: 0 auto; font-size: 1.1rem; }

/* bảng lịch tuần */
.v31-gt { border-radius: 20px; }
.v31-gt .gt th { background: var(--sheet-2); font-size: .8rem; font-weight: 660; color: var(--ink-2); text-align: left; padding: .7rem .9rem; }
.v31-gt .gt td { padding: .8rem .9rem; }
.v31-gt-n { display: block; min-width: 11rem; }
.v31-gt-a { color: var(--muted); font-size: .86rem; max-width: 16rem; }
.v31-gt-n b { display: block; font-weight: 650; }
.v31-gt-n small { display: block; font-size: .8rem; color: var(--muted); line-height: 1.4; }
@media (hover: hover) and (pointer: fine) { .v31-gt-n:hover b { color: var(--season-ink); text-decoration: underline; text-underline-offset: 3px; } }
.v31-gt-d { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 650; color: var(--ink-2); }
.v3 .t-hit { background: var(--season-tint); border-color: var(--season); color: var(--season-ink); }

/* ------------------------------------------------- dòng nhà thờ (trang địa phương) */
.v31-crs { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.v31-cr {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--line-2); transition: background-color .15s ease;
}
.v31-cr:first-child { border-top: 0; }
@media (hover: hover) and (pointer: fine) { .v31-cr:hover { background: var(--sky-0); } .v31-cr:hover .v31-cr-n b { color: var(--season-ink); } }
.v31-cr-n { min-width: 0; }
.v31-cr-n b { display: block; font-weight: 650; line-height: 1.35; transition: color .15s ease; }
.v31-cr-n small { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v31-cr-t { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.v31-cr-t .t { min-width: 3.4rem; font-size: .84rem; padding: .16rem .35rem; text-align: center; }
.v31-cr-d { min-width: 2rem; font-size: .76rem; font-weight: 700; color: var(--muted); }
.v31-cr-d.sun { color: var(--red-ink); }
.v31-cr-g {
  padding: 9px 20px; background: var(--sheet-2); border-top: 1px solid var(--line); font-size: .82rem;
  font-weight: 680; color: var(--ink-2);
}
.v31-cr-g:first-child { border-top: 0; }
.v31-cr-g small { font-weight: 500; color: var(--muted); margin-left: 6px; }

/* ===================================================================
   LỄ GẦN BẠN
   =================================================================== */
.v31-loc {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; margin-bottom: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
}
.v31-loc > .ic { width: 20px; height: 20px; color: var(--season-ink); }
.v31-loc-t { flex: 1 1 280px; min-width: 0; font-size: .95rem; color: var(--ink-2); line-height: 1.45; }
.v31-loc-t b { color: var(--ink); }
.v31-loc-t small { display: block; font-size: .8rem; color: var(--muted); }
.v31-loc .sel { width: auto; min-width: 190px; min-height: 40px; font-size: .92rem; background-color: #fff; }
.v31-loc.warn { background: var(--live-tint); border-color: color-mix(in srgb, var(--live) 40%, var(--line)); }
.v31-loc.warn > .ic { color: var(--live-ink); }
.v31-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 16px; }
.v31-ctl-g { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v31-ctl-l { font-size: .88rem; color: var(--muted); margin-right: 2px; }

.v31-near-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(20px, 3vw, 36px); align-items: start; }
.v31-near-side { position: sticky; top: calc(var(--hdr-h) + 16px); }
.v31-nrs { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.v31-nr {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 18px; border-top: 1px solid var(--line-2); transition: background-color .15s ease;
}
.v31-nr:first-child { border-top: 0; }
@media (hover: hover) and (pointer: fine) { .v31-nr:hover { background: var(--sky-0); } .v31-nr:hover .v31-nr-c b { color: var(--season-ink); } }
.v31-nr-i {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.4px solid var(--ink); font-size: .76rem; font-weight: 720;
}
.v31-nr-c { min-width: 0; }
.v31-nr-c b { display: block; font-size: 1.04rem; font-weight: 660; line-height: 1.35; transition: color .15s ease; }
.v31-nr-c small { display: block; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.v31-nr-c small strong { color: var(--ink); font-weight: 680; }
/* lịch lễ cả tuần dưới tên nhà thờ: ba dòng Chúa Nhật, Thứ Bảy, Ngày thường */
.v31-nr { row-gap: 10px; }
.v31-wk { grid-column: 2 / -1; display: grid; gap: 5px; padding-top: 9px; border-top: 1px dashed var(--line); }
.v31-wk-r { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; }
.v31-wk-l { padding-top: 4px; font-size: .78rem; font-weight: 640; color: var(--muted); white-space: nowrap; }
.v31-wk-l.sun { color: var(--red-ink); }
.v31-wk-t { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.v31-wk-t .t { min-width: 3.3rem; padding: .14rem .4rem; font-size: .84rem; }
.v31-wk-t .v31-none { padding-top: 4px; }
/* giờ ngày thường không đủ năm ngày: ghi kèm thứ ngay trong ô */
.t.t-tag small { margin-left: 1px; font-size: .7rem; font-weight: 640; color: var(--muted); }
.t-next.t-tag small { color: inherit; opacity: .8; }
.v3 .t-next.soon { background: var(--live-tint); border-color: var(--live); color: var(--live-ink); }
.v31-nr-n { display: grid; justify-items: end; gap: 2px; text-align: right; }
.v31-nr-w { font-size: .72rem; font-weight: 600; color: var(--muted); }
.v31-nr-n b { font-size: 1.5rem; font-weight: 740; font-stretch: 104%; line-height: 1.05; font-variant-numeric: tabular-nums; }
.v31-nr-cd { padding: 2px 9px; border-radius: 999px; background: var(--season-tint); color: var(--season-ink); font-size: .76rem; font-weight: 660; white-space: nowrap; }
.v31-nr-cd.soon { background: var(--live-tint); color: var(--live-ink); }
.v31-nr-note { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--sheet-2); font-size: .86rem; color: var(--ink-2); }

/* thẻ hướng dẫn: vừa gần vừa đúng giờ */
.v31-guide {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 18px; border-top: 1px solid var(--line); background: var(--season-tint);
}
.v31-guide h3 { font-size: 1.02rem; font-weight: 700; margin: 0 0 3px; font-stretch: 104%; }
.v31-guide p { margin: 0; font-size: .86rem; color: var(--ink-2); line-height: 1.5; }
.v31-guide .btn { white-space: nowrap; }
.v31-gg { width: 64px; height: 64px; display: block; overflow: visible; }
.gg-ring { fill: none; stroke: var(--season-ink); stroke-opacity: .35; stroke-dasharray: 2.5 3.5; }
.gg-face { fill: #fff; stroke: var(--ink); stroke-width: 1.8; }
.gg-tick { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.gg-h, .gg-m { stroke: var(--ink); stroke-linecap: round; transform-box: view-box; transform-origin: 36px 36px; }
.gg-h { stroke-width: 2.6; transform: rotate(150deg); }
.gg-m { stroke-width: 1.9; }
.gg-pin { fill: var(--ink); }
.gg-dot { fill: var(--live); stroke: #fff; stroke-width: 1.4; }
.v31-guide.in .gg-m { animation: gg-sweep 1.4s var(--ease-out) .2s both; }
@keyframes gg-sweep { from { transform: rotate(-200deg); } to { transform: rotate(0deg); } }

/* bản đồ vòng bán kính */
.v31-rd-box { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.v31-rd-box h2 { font-size: 1.05rem; font-stretch: 106%; margin: 0 0 4px; }
.v31-rd-box p { margin: 0 0 10px; font-size: .82rem; color: var(--muted); }
.v31-rd { display: block; width: 100%; height: auto; background: var(--sky-0); border: 1px solid var(--line-2); border-radius: 16px; font-family: var(--f-ui); }
.v31-rd-grid { fill: none; stroke: var(--sky-ink); stroke-opacity: .07; }
.v31-rd-ring { fill: color-mix(in srgb, var(--season) 6%, transparent); stroke: var(--season-ink); stroke-opacity: .5; stroke-dasharray: 3 4; transform-box: fill-box; transform-origin: center; }
.v31-rd-ring-2 { fill: none; stroke-opacity: .3; }
.v31-rd-l { font-size: 10px; font-weight: 600; fill: var(--muted); }
.v31-rd-n { font-size: 10px; font-weight: 700; fill: var(--muted-2); }
.v31-rd-pt circle { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.v31-rd-pt text { font-size: 10.5px; font-weight: 720; fill: var(--ink); }
.v31-rd-pt:first-of-type circle { fill: var(--live-tint); stroke: var(--live-ink); }
.v31-rd-me { fill: var(--season); stroke: #fff; stroke-width: 2.4; }
.v31-rd-me-o { fill: var(--season); opacity: .16; transform-box: fill-box; transform-origin: center; }
.v3-js .v31-rd:not(.in) .v31-rd-ring { transform: scale(.82); opacity: 0; }
.v3-js .v31-rd:not(.in) .v31-rd-pt { opacity: 0; }
.v31-rd.in .v31-rd-ring { transition: transform .7s var(--ease-out), opacity .4s ease; }
.v31-rd.in .v31-rd-pt { transition: opacity .35s ease; transition-delay: calc(var(--i) * 55ms + 250ms); }
.v31-rd.in .v31-rd-me-o { animation: xa-pin 1.1s var(--ease-out) both; }

/* ===================================================================
   DANH MỤC ĐỊA PHƯƠNG (trang 34 tỉnh thành, trang 27 giáo phận)
   Danh sách bên trái, bản đồ dính bên phải. Trỏ vào một nơi thì nơi đó
   sáng lên trên bản đồ. Không còn vạch so sánh số nhà thờ.
   =================================================================== */
.v31-dir-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.v31-dir-wrap + .v31-hub-sec { margin-top: 48px; }
.v31-dir-body { columns: 2 280px; column-gap: clamp(24px, 3vw, 40px); }
.v31-dir-g { break-inside: avoid; margin: 0 0 28px; }
.v31-dir-g h3 {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-bottom: 8px; margin: 0 0 4px;
  border-bottom: 1.5px solid var(--ink); font-size: .98rem; font-weight: 700; font-stretch: 104%; cursor: default;
}
.v31-dir-g h3 small { font-size: .76rem; font-weight: 500; color: var(--muted); }
.v31-dir-g ul { margin: 0; padding: 0; list-style: none; }
.v31-dir-g li { border-bottom: 1px solid var(--line-2); }
.v31-dir-g li > a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  min-height: 46px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px;
  transition: background-color .15s ease, color .15s ease;
}
.v31-dir-n { min-width: 0; font-weight: 600; font-size: .96rem; line-height: 1.3; }
.v31-dir-n small { display: block; margin-top: 1px; font-size: .76rem; font-weight: 450; color: var(--muted); }
.v31-dir-n .v31-kind { margin-left: 6px; }
.v31-dir-c { text-align: right; font-weight: 680; font-size: .92rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.v31-dir-c.none { font-weight: 500; font-size: .76rem; color: var(--muted-2); }
@media (hover: hover) and (pointer: fine) {
  .v31-dir-g li > a:hover { background: var(--sky-0); }
  .v31-dir-g li > a:hover .v31-dir-n { color: var(--season-ink); }
}
.v31-dir-g li > a:focus-visible { background: var(--sky-0); }
.v31-dir-s { max-width: 420px; margin-bottom: 26px; background: #fff; }

/* bản đồ bên cạnh danh mục */
.v31-dir-side { position: sticky; top: calc(var(--hdr-h) + 16px); }
.v31-dm-box { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px 16px 14px; box-shadow: var(--sh-card); }
.v31-dm-h { min-height: 4.4em; }
.v31-dm-h b { display: block; font-size: 1.12rem; font-weight: 720; font-stretch: 106%; line-height: 1.3; }
.v31-dm-h span { display: block; margin-top: 3px; font-size: .84rem; color: var(--ink-2); line-height: 1.45; }
.v31-dm { display: block; width: 100%; height: auto; margin-top: 6px; font-family: var(--f-ui); }
.v31-dm .dm-land circle { fill: #DFE8F3; }
.v31-dm .dm-g circle {
  fill: #8EA8C6; transform-box: fill-box; transform-origin: center;
  transition: fill .2s ease, opacity .2s ease, transform .28s var(--ease-out);
}
.v31-dm.focus .dm-g circle { opacity: .35; }
.v31-dm.focus .dm-g.on circle { opacity: 1; fill: var(--season); transform: scale(1.6); }
.v3-js .v31-dm:not(.in) .dm-g circle { opacity: 0; transform: scale(.3); }
.v31-dm.in .dm-g circle { transition-delay: var(--d, 0ms), var(--d, 0ms), 0s; }
.v31-dm.in.focus .dm-g circle { transition-delay: 0s; }
.dm-isl { font-size: 2.3px; font-weight: 600; fill: var(--muted); }
.v31-dm-cap { margin: 10px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; }

/* ===================================================================
   BẢN ĐỒ NHỎ
   =================================================================== */
.v31-mm { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--f-ui); }
.mm-land { fill: #C9D7E7; }
.mm-ch { fill: #9DB4CD; }
.mm-isl { fill: #5A7696; }
.mm-hit { fill: var(--season); transform-box: fill-box; transform-origin: center; }
.v3-js .v31-mm:not(.in) .mm-hit { opacity: 0; transform: scale(.3); }
.v31-mm.in .mm-hit { transition: opacity .35s ease, transform .5s var(--ease-out); transition-delay: var(--d, 0ms); }
.mm-isl-l { font-size: 2.3px; font-weight: 600; fill: var(--muted); }
.mm-lab path { fill: none; stroke: var(--ink); stroke-width: .25; }
.mm-lab text { font-size: 3px; font-weight: 720; fill: var(--ink); paint-order: stroke; stroke: var(--ground); stroke-width: .9px; stroke-linejoin: round; }

/* ===================================================================
   TRANG TỈNH THÀNH, GIÁO PHẬN
   =================================================================== */
.v31-hub-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 56px); align-items: start; margin-bottom: clamp(28px, 4vw, 44px); }
.v31-hub-hero h1 { font-size: clamp(2rem, 1.25rem + 2.6vw, 3.3rem); font-stretch: 110%; font-weight: 750; letter-spacing: -.034em; line-height: 1.12; margin: 0 0 12px; }
.v31-hub-hero p { margin: 0 0 18px; max-width: 62ch; color: var(--ink-2); line-height: 1.6; }
.v31-hub-map { max-width: 300px; justify-self: end; width: 100%; }
.v31-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 20px; }
.v31-stat { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.v31-stat b { display: block; font-size: 1.7rem; font-weight: 740; font-stretch: 104%; line-height: 1.1; font-variant-numeric: tabular-nums; }
.v31-stat span { display: block; margin-top: 3px; font-size: .8rem; color: var(--muted); line-height: 1.35; }
.v31-hub-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.v31-hub-acts .btn { min-height: 44px; }
.v31-hub-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 22px; padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); line-height: 1.55; }
.v31-hub-note .ic { flex: none; margin-top: 3px; color: var(--season-ink); }
.v31-hub-note a { color: var(--season-ink); font-weight: 620; text-decoration: underline; text-decoration-color: var(--season-tint-2); text-underline-offset: 3px; }
.v31-hub-sec + .v31-hub-sec { margin-top: 40px; }
.v31-hub-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.v31-hub-h h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); font-stretch: 108%; }
.v31-hub-h p { margin: 0; color: var(--muted); font-size: .92rem; }
.v31-hub-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.v31-hub-tools .search { max-width: 420px; background: #fff; }
.v31-hats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.v31-hats .v31-chip-sm { flex: none; }

/* ===================================================================
   TRANG CHỦ
   =================================================================== */
.v3-actions .v3-act-t small { margin-top: 4px; }
.v3-act-q { display: block; font-size: .8rem; font-weight: 600; color: var(--season-ink); margin-bottom: 2px; }
.dc-hit { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
.dc-hover { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1.5px dashed var(--ink); opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.dc-hover span {
  position: absolute; bottom: calc(100% + 4px); left: 0; transform: translateX(-50%); padding: 4px 9px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: .74rem; font-weight: 620; white-space: nowrap;
}
.dc-hover.on { opacity: 1; }
.v3-day-s .link-u { font-size: inherit; }

/* hai lối vào lớn ở thẻ "Duyệt theo địa phương": trang chủ không còn danh
   mục địa phương, nên hai nút này là cửa chính sang hai trang danh sách */
.v31-way-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.v31-way-btn {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; align-items: center; gap: 12px;
  min-height: 74px; padding: 12px 14px 12px 16px; border-radius: 16px;
  background: var(--season-btn); color: var(--on-season-btn);
  box-shadow: 0 1px 2px rgba(12,30,51,.08), 0 12px 24px -16px rgba(12,30,51,.55);
  transition: background-color .18s ease, transform .16s var(--ease-out);
}
.v31-way-btn b { font-size: 2rem; font-weight: 760; font-stretch: 108%; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.v31-way-btn span { min-width: 0; font-weight: 680; font-size: 1.04rem; line-height: 1.25; }
.v31-way-btn small { display: block; margin-top: 3px; font-size: .76rem; font-weight: 500; line-height: 1.3; opacity: .85; }
.v31-way-btn .ic { width: 18px; height: 18px; transition: transform .25s var(--ease-out); }
.v31-way-btn:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .v31-way-btn:hover { background: var(--season-btn-h); }
  .v31-way-btn:hover .ic { transform: translateX(3px); }
}
@media (max-width: 420px) { .v31-way-btns { grid-template-columns: minmax(0, 1fr); } }

/* lịch 7 ngày: danh sách nhà thờ của ngày đã chọn */
.v31-week-list { margin-top: 18px; }
.v31-sb-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--sheet-2); font-size: .88rem; color: var(--ink-2); }

/* ===================================================================
   GIỚI THIỆU, ĐÓNG GÓP: khối tối của bản 1 đổi sang nền sáng
   =================================================================== */
.v3 .hero-ch { background: var(--season-tint); color: var(--ink); border: 1px solid var(--season-tint-2); }
.v3 .hero-ch h1 { color: var(--ink); }
.v3 .hero-ch p { color: var(--ink-2) !important; }
.v3 .cta-band { background: var(--season-tint); color: var(--ink); border: 1px solid var(--season-tint-2); }
.v3 .cta-band h2 { color: var(--ink); }
.v3 .cta-band p { color: var(--ink-2); }
.v3 .cta-band .btn-b { background: var(--season-btn); color: var(--on-season-btn); }
.v3 .cta-band .btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }

/* ===================================================================
   MÀN HÌNH NHỎ
   =================================================================== */
@media (max-width: 1080px) {
  .v31-near-wrap, .v31-dir-wrap { grid-template-columns: minmax(0, 1fr); }
  .v31-near-side, .v31-dir-side { display: none; }
}
@media (max-width: 900px) {
  .v31-hub-hero { grid-template-columns: minmax(0, 1fr) 150px; gap: 18px; }
  .v31-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v31-extra-b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .v31-prow { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 0; }
  .v31-plabel { padding-top: 0; }
  .v31-area .sel { min-width: 0; width: 100%; }
  .v31-slots { flex-wrap: nowrap; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
  .v31-slots::-webkit-scrollbar { display: none; }
  .v31-chip { flex: none; }
  /* dải nhịp lễ: kéo dài và cuộn ngang, thấy tám tiếng một lúc */
  .v31-rib-sc {
    margin: 0 -16px; padding: 8px 16px 0; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  }
  .v31-rib-sc::-webkit-scrollbar { display: none; }
  .v31-rib-plot { height: 64px; }
  .v31-rib-bars { gap: 2px; }
  .v31-rib-axis span.h1 { display: block; }
  .v31-rib-axis span.h3 { font-weight: 640; color: var(--ink-2); }
  .v31-hours-g { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .v31-hours-l { padding-top: 0; }
  .v31-extra-b { grid-template-columns: minmax(0, 1fr); }
  .v31-res-h { align-items: stretch; flex-direction: column; }
  .v31-res-tools { justify-content: space-between; }
  .v31-mr { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; padding: 11px 14px; }
  .v31-mr-t { font-size: 1.08rem; }
  .v31-mr-c small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .v31-mr-h { padding: 9px 14px; }
  .v31-cr { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 14px; }
  .v31-cr-g { padding: 9px 14px; }
  .v31-nr { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; padding: 13px 14px; }
  .v31-wk-r { grid-template-columns: 75px minmax(0, 1fr); gap: 5px; }
  .v31-wk-l { font-size: .74rem; }
  .v31-wk-t { gap: 4px; }
  .v31-wk-t .t { min-width: 2.85rem; font-size: .8rem; padding: .12rem .28rem; }
  .v31-nr-c small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .v31-nr-c b { font-size: 1rem; }
  .v31-nr-n b { font-size: 1.28rem; }
  .v31-guide { grid-template-columns: 48px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .v31-guide .v31-gg { width: 48px; height: 48px; }
  .v31-guide .btn { grid-column: 1 / -1; justify-content: center; }
  .v31-dir-body { columns: auto; }
  .v31-dir-n { font-size: .94rem; }
  .v31-sum { padding-left: 14px; }
  .v31-sum-t { font-size: .8rem; }
  .v31-sb-f { padding: 12px 14px; }
  .v31-sb-f .btn { width: 100%; height: auto; min-height: 44px; white-space: normal; text-align: left; justify-content: space-between; line-height: 1.35; padding-top: .55rem; padding-bottom: .55rem; }
  /* bảng lịch tuần thành thẻ xếp dọc */
  .v31-gt .gt thead { display: none; }
  .v31-gt .gt, .v31-gt .gt tbody, .v31-gt .gt tr, .v31-gt .gt td { display: block; width: 100%; }
  .v31-gt .gt tr { padding: 10px 14px; border-top: 1px solid var(--line); }
  .v31-gt .gt tr:first-child { border-top: 0; }
  .v31-gt .gt td { padding: 4px 0; border: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: start; }
  .v31-gt .gt td::before { content: attr(data-c); font-size: .76rem; font-weight: 640; color: var(--muted); padding-top: 4px; }
  .v31-gt .gt td:first-child { display: block; padding-bottom: 6px; }
  .v31-gt .gt td:first-child::before { content: none; }
  .v31-gt-n { min-width: 0; }
}
@media (max-width: 620px) {
  /* điện thoại: bản đồ nhỏ quá thì không còn đọc được, nhường chỗ cho tên và con số */
  .v31-hub-hero { grid-template-columns: minmax(0, 1fr); }
  .v31-hub-map { display: none; }
  .v31-stat { padding: 11px 12px; }
  .v31-stat b { font-size: 1.35rem; }
  .v31-head h1 { font-size: 2.1rem; }
}
.v31-rd-nl { stroke: var(--muted-2); stroke-width: 1; }
@media (max-width: 760px) {
  .v31-head-tight { margin-bottom: 14px; }
  .v31-head-tight p { display: none; }
  .v31-loc { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px 14px; }
  .v31-loc-t { grid-column: 2 / -1; font-size: .9rem; }
  .v31-loc-t small { display: none; }
  .v31-loc .sel { grid-column: 1 / 3; min-width: 0; width: 100%; }
  .v31-loc .btn { grid-column: 3; }
  .v31-loc > .btn:only-of-type:last-child { justify-self: end; }
  .v31-ctl { margin: 0 -16px 10px; }
  .v31-ctl-g { flex-wrap: nowrap; overflow-x: auto; padding: 2px 16px 6px; scrollbar-width: none; }
  .v31-ctl-g::-webkit-scrollbar { display: none; }
  .v31-ctl-g > * { flex: none; }
  .v31-res-h-row { flex-direction: row !important; align-items: center !important; }
  .v31-res-h-row .v31-res-n { font-size: 1rem; }
  .v31-res-h-row .v31-seg button { padding: 5px 11px; font-size: .84rem; }
}
@media (max-width: 620px) { .v31-hide-sm { display: none; } }

/* ô chọn nơi ở đầu bảng "Lễ sắp diễn ra" */
.v31-where { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.v31-where > .ic { width: 18px; height: 18px; color: var(--season-ink); }
.v31-where > span { font-size: .9rem; color: var(--ink-2); }
.v31-where .sel { width: auto; min-width: 170px; min-height: 38px; padding: .35rem 2.2rem .35rem .75rem; font-size: .9rem; font-weight: 580; background-color: #fff; }
.v3-board.v31-prov .v3-row-dist { font-weight: 560; font-size: .86rem; line-height: 1.35; color: var(--ink-2); }
@media (max-width: 760px) { .v31-where { justify-content: flex-start; } }

/* trang một nhà thờ: tên và lễ tiếp theo trước, dãy nút sau (nhất là trên điện thoại) */
.v3-chp-hero { grid-template-rows: auto 1fr; }
.v3-chp-hero .v3-chp-id { grid-column: 1; grid-row: 1; }
.v3-chp-hero .v3-chp-next { grid-column: 2; grid-row: 1 / span 2; }
.v3-chp-hero .v31-chp-acts { grid-column: 1; grid-row: 2; align-self: start; margin-top: 0; }
@media (max-width: 1000px) {
  .v3-chp-hero { grid-template-rows: none; gap: 16px; }
  .v3-chp-hero .v3-chp-id, .v3-chp-hero .v3-chp-next, .v3-chp-hero .v31-chp-acts { grid-column: 1; grid-row: auto; }
}
@media (max-width: 620px) {
  .v31-chp-acts .btn { flex: 1 1 calc(50% - 8px); padding-left: .6rem; padding-right: .6rem; }
}
.v3-crumbs a + .sep, .v3-crumbs .sep { margin: 0 2px; }
/* dòng "Cập nhật ngày" của lịch tuần (bản Django): hết chỗ thì xuống dòng cả cụm, không tách rời ngày */
.v31-cap-nhat { white-space: nowrap; }

.v31-note-s { margin: 0 0 10px; font-size: .86rem; color: var(--muted); }
.v31-mr-h small { margin-left: 8px; font-weight: 500; color: var(--muted); }
.v31-mr-more {
  display: block; width: 100%; padding: 11px 20px; border-top: 1px solid var(--line-2); background: var(--sheet-2);
  font-size: .86rem; font-weight: 640; color: var(--season-ink); text-align: left;
}
@media (hover: hover) and (pointer: fine) { .v31-mr-more:hover { background: var(--sky-0); } }

/* ===================================================================
   LỄ SẮP DIỄN RA: bảng giờ đứng giữa, nhà thờ lớn phía sau
   Tháp chuông (có đồng hồ) ló lên trên bảng, bậc thềm và con phố lộ ra
   bên dưới. Hình neo theo tâm màn hình, không co giãn trên máy tính.
   =================================================================== */
.v31-next { padding: 316px 0 86px; }
.v31-next .v3-board { margin: 0 auto; }
.v31-church { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.v31-ch-top { position: absolute; top: 20px; left: 50%; width: 1200px; max-width: none; height: 1600px; margin-left: -600px; }
.v31-ch-st { position: absolute; bottom: 0; left: 50%; width: 1920px; max-width: none; height: 224px; margin-left: -960px; overflow: visible; }
.il-shade { fill: var(--ink); opacity: .2; }
/* kim đồng hồ quay quanh tâm mặt đồng hồ của tháp mới */
.v31-church #ilHour, .v31-church #ilMin { transform-origin: 600px 244px; }
.v31-church #ilBell { transform-box: view-box; transform-origin: 600px 123px; }
.v31-church .bell-wave { opacity: 0; transform-box: view-box; transform-origin: 600px 140px; }
.v31-church.loop #ilBell { animation: bell-loop 5s var(--ease-move) infinite; }
.v31-church.loop .bell-wave { animation: bell-wave 5s ease-out infinite; }
@keyframes bell-loop {
  0% { transform: rotate(0); } 5% { transform: rotate(14deg); } 11% { transform: rotate(-11deg); }
  16.5% { transform: rotate(6deg); } 21.5% { transform: rotate(-3deg); } 25%, 100% { transform: rotate(0); }
}
@keyframes bell-wave {
  0%, 3% { opacity: 0; transform: scale(.86); } 8% { opacity: .85; }
  24% { opacity: 0; transform: scale(1.18); } 100% { opacity: 0; transform: scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .v31-church.loop #ilBell, .v31-church.loop .bell-wave { animation: none; }
}
@media (max-width: 860px) {
  .v31-next .v3-board { margin: 0 auto; }
}
@media (max-width: 760px) {
  /* điện thoại: thu tháp chuông lại, chỉ còn tháp ló trên bảng và bậc thềm bên dưới */
  .v31-next { padding: 208px 0 74px; }
  .v31-ch-top { top: 14px; transform: scale(.62); transform-origin: 600px 0; }
}

/* =============================================================================
   Lớp thay cho style nội dòng (D39). Giá trị thiết kế chỉ nằm trong CSS;
   chỗ nào còn style trong JS là số liệu tính lúc chạy (--i, --d, --h, left %).
   ============================================================================= */
/* dùng chung */
.v31-acts { margin-top: 1.4rem; }
.btn-block { width: 100%; }
.svg-sprite { display: none; }
/* ô bẫy chống gửi tự động ở biểu mẫu: người thật không thấy, máy dò thường điền vào */
.rp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* thông báo sau khi gửi biểu mẫu (bản Django) */
.v31-msgs { padding-top: 1rem; }
.empty-sm { padding: 2rem 1rem; }
.v31-empty-p { max-width: 44ch; margin: .5rem auto 1.2rem; }
.v31-empty-bare { border: 0; }
.v31-empty-acts { justify-content: center; margin-top: 1rem; }
.v31-hub-note.flush { margin: 0; }
.v31-sugg-sub { display: block; }
.v31-warn { color: var(--c-600); }
/* trang nhà thờ: ghi chú linh mục, hộp nhà thờ gần đây, hộp nhận quản lý */
.v31-pri-note { margin: .6rem 0 0; }
.v31-near-all { margin-top: .8rem; }
.v3-side-claim p { margin: 0 0 .6rem; }
.v3-side-claim p:last-of-type { margin-bottom: .9rem; }
/* chân trang */
.ftr-brand { gap: .6rem; margin-bottom: .8rem; }
.ftr-about { max-width: 38ch; line-height: 1.62; }
.ftr-links { --gap: .45rem; }
/* thẻ nhà thờ, hộp báo sai */
.ch-min { font-weight: 450; }
.rp-name { color: var(--ink); }
.rp-file { margin-top: .5rem; }
.modal-f.modal-f-in { padding-left: 0; padding-right: 0; margin-top: 1rem; }
/* trang Giới thiệu */
.v31-head-doc { margin-bottom: 2.4rem; }
.v31-head-doc h1 { max-width: 20ch; }
.v31-doc-grid { display: grid; gap: 2.4rem; align-items: start; }
@media (min-width: 940px) { .v31-doc-grid { grid-template-columns: 220px 1fr; } }
@media (max-width: 939px) { .v31-doc-grid .toc { display: none; } }
.toc-h { display: block; margin: 0 0 .5rem .75rem; font-size: .9rem; }
.v31-doors { --gap: .9rem; margin-bottom: 1.4rem; }
.v31-door { display: flex; gap: 1rem; }
.v31-door .entry-ic { flex: none; margin: 0; }
.v31-door-t { font-size: 1.02rem; font-family: var(--f-display); }
.v31-door p.small { margin: .3rem 0 .6rem; color: var(--ink-2); }
.v31-col-term { width: 130px; }
/* chữ đậm trong bài văn xuôi: <b> viết tay và <strong> từ Markdown cùng một màu */
.prose b { color: var(--ink); }
/* trang Gửi giờ lễ */
.v31-head-mid { margin-bottom: 1.8rem; }
.v31-block { margin-bottom: 2.4rem; }
.v31-band-note h2 { margin: 0 0 .6rem; max-width: 26ch; }
.v31-band-note p { max-width: 60ch; }
.v31-form-sec { scroll-margin-top: 90px; }
.v31-form-sec > h2 { font-size: 1.45rem; margin-bottom: .3rem; }
.v31-form-sec > p.muted { max-width: 66ch; }
.v31-form-sec > p + .card { margin-top: 1rem; }
.v31-suggest-wrap { position: relative; }
.v31-ta-times { min-height: 120px; }
.v31-inp-more { margin-top: .5rem; }
.v31-benefits { margin-bottom: 1.2rem; }
.v31-benefits h3 { font-size: 1rem; margin-bottom: .7rem; }
.v31-benefits .stack { --gap: .7rem; }
.v31-benefit { display: flex; gap: .7rem; }
.v31-benefit b { font-size: .9rem; }
.v31-benefit .small { margin-top: .1rem; }
.v31-side { --gap: 1rem; }
.v31-side .side-box > p { margin: 0 0 .8rem; }
.v31-side .side-box > p:last-child { margin: 0; }
.v31-side .side-box ul.stack { --gap: .55rem; color: var(--ink-2); }
.v31-needs-note { margin: .7rem 0 0; }
/* Hệ nét của hình minh hoạ: mảnh 1 (il-thin), nhỏ 1.2, vừa 1.4, chuẩn 1.6
   (il-line), đậm 2.2. Hình sinh tự động dùng đúng năm bậc này. */
.il-fine { stroke-width: 1.2; }
.il-mid { stroke-width: 1.4; }
.il-bold { stroke-width: 2.2; }
.il-dash { stroke-dasharray: 2 5; }
.nb-stamp .nb-in { stroke-width: 1; }
.v31-ch-top .il-hand { stroke-width: 3; }
.v31-ch-top .il-hand-m { stroke-width: 2; }

/* trang nhà thờ: tag cảnh báo nhẹ cho nhà thờ có cờ D63, bấm vào mở hộp báo sai */
.v31-flag { font-family: inherit; line-height: inherit; cursor: pointer;
            transition: border-color .15s ease, transform .12s var(--ease-out); }
.v31-flag .ic { width: 16px; height: 16px; color: var(--red-ink); }
.v31-flag:active { transform: scale(.97); }
.v31-flag:focus-visible { outline: 2px solid var(--season-ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .v31-flag:hover { border-color: var(--red-ink); } }

/* Nhóm trang "Về Giờ Lễ Việt" (D75, D81): khối điều hướng cuối trang, thẻ nguyên tắc,
   mẫu ba dấu hiệu trên trang nhà thờ, nút tắt đếm lượt xem, link pháp lý ở chân trang */
.v31-ve-glv { margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.v31-ve-glv-h { display: block; margin-bottom: .75rem; font-size: .95rem; color: var(--ink); }
.prose .v31-ve-glv-ds { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.prose .v31-ve-glv-ds li { margin: 0; padding: 0; }
.prose .v31-ve-glv-ds li::before { content: none; }
.v31-ve-glv-ds a, .v31-ve-glv-ds span { display: inline-flex; align-items: center; min-height: 40px;
  padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--sheet);
  font-size: .92rem; color: var(--ink-2); transition: border-color .15s ease, color .15s ease; }
.v31-ve-glv-ds span[aria-current] { border-color: var(--season); background: var(--season-tint);
  color: var(--season-ink); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .v31-ve-glv-ds a:hover { border-color: var(--season); color: var(--season-ink); } }
.v31-nguyen-tac { margin-bottom: 1.6rem; }
.v31-nguyen-tac .v31-door p.small { margin-bottom: 0; }
.v31-signs { --gap: .9rem; margin-bottom: 1.4rem; }
.v31-sign-demo { margin-bottom: .6rem; }
.v31-sign-t { font-weight: 600; color: var(--ink); }
.v31-sign p.small { margin: 0; color: var(--ink-2); }
.v31-flag-mau { cursor: default; }
.v31-tat-do { margin-bottom: 1.4rem; }
.v31-tat-do p.small { margin: .45rem 0 .7rem; }
.v31-tat-do-tt { font-weight: 600; color: var(--ink); }
.ftr-legal { display: inline-flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
/* ô lưới của trang văn xuôi không được nở theo bảng rộng (quy ước code 8); bảng
   nhiều cột giữ bề ngang tối thiểu và cuộn ngang trong .tbl-scroll trên điện thoại */
.v31-doc-grid > * { min-width: 0; }
.v31-tbl-rong { min-width: 36rem; }
/* Biểu mẫu gửi lên máy chủ (D85): hộp kiểm tra chống tin rác của Cloudflare
   Turnstile (turnstile.js, sáu trạng thái ở data-tt), lời báo khi gửi hỏng, nút
   Gửi đang bận. Hộp nằm ngay trên nút Gửi, cùng giọng với dòng gợi ý của ô nhập */
.v31-ts { margin: -.2rem 0 1.05rem; font-size: .875rem; color: var(--ink-2); }
.v31-ts-dong { display: flex; align-items: center; gap: .5rem; min-height: 1.6rem; }
.v31-ts-dau { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.1rem; color: var(--muted); }
.v31-ts-dau .ic { width: 1.1rem; height: 1.1rem; }
.v31-ts-chu { flex: 1 1 auto; min-width: 0; }
.v31-ts[data-tt="verified"] .v31-ts-dau { color: var(--season-ink); }
.v31-ts[data-tt="interactive"] .v31-ts-chu { color: var(--ink); font-weight: 600; }
.v31-ts[data-tt="error"] .v31-ts-dau, .v31-ts[data-tt="error"] .v31-ts-chu { color: var(--red-ink); }
.v31-ts-lai { flex: none; min-height: 44px; padding: 0 .35rem; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--season-ink); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; }
.v31-ts[data-tt="interactive"] .v31-ts-khung { margin-top: .6rem; }
.v31-ts-giup { margin-top: .4rem; padding: .7rem .85rem; border-radius: var(--r-sm);
  background: var(--red-tint); color: var(--ink-2); }
.v31-ts-giup p { margin: 0; }
.v31-ts-giup .v31-ts-ma { margin-top: .35rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.v31-ts-xoay { display: inline-block; flex: none; width: .95rem; height: .95rem;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: v31-ts-xoay .8s linear infinite; }
@keyframes v31-ts-xoay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .v31-ts-xoay { animation-duration: 2.4s; } }
.v31-gui-loi { margin-bottom: 1.05rem; }
.btn.v31-ban:disabled { opacity: .8; }
/* Logo C2 (D86): khung tô màu mùa phụng vụ, chuông và vạch giờ màu chữ trên nền
   mùa. Mùa vàng (Giáng Sinh, Phục Sinh) chữ trên nền là màu tối, nên chuông cũng tối,
   đúng như bảng C2 ở trang thiết kế */
.brand-mark svg [fill="#fff"] { fill: var(--on-season-btn); }
.brand-mark svg [stroke="#fff"] { stroke: var(--on-season-btn); }
/* Dòng nhắc dịp Giáng Sinh trên trang nhà thờ, 01/12 tới 06/01 (P16, D87) */
.v31-nhac-le { margin-bottom: .9rem; }
