/* ==========================================================================
   CHÙA ONLINE — các trang tính năng: lịch âm, bàn thờ gia tiên, sổ cầu an,
   tu tập, sổ công đức, quẻ xăm, thêm vào chánh điện.
   ========================================================================== */
:root { --co-strip-h: 34px; }

/* ------------------------------------------------------------------ dải lịch âm dưới header */
.co-lunar { background: #0f0504; border-bottom: 1px solid var(--co-line); height: var(--co-strip-h); }
.co-lunar-in {
  max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
  font-family: var(--co-f-ui); font-size: 13px; color: var(--co-muted); white-space: nowrap; overflow: hidden;
}
.co-lunar-today { display: flex; align-items: baseline; gap: 8px; color: var(--co-text); text-decoration: none; }
.co-lunar-k { color: var(--co-leaf); }
.co-lunar-today strong { font-family: var(--co-f-head); font-size: 15px; color: var(--co-paper); }
.co-lunar-next { color: var(--co-leaf-hi); overflow: hidden; text-overflow: ellipsis; }
.co-lunar-remind {
  margin-left: auto; font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-text);
  background: none; border: 1px solid var(--co-line); padding: 3px 10px; cursor: pointer;
}
.co-lunar-remind:hover { border-color: var(--co-leaf-hi); color: var(--co-leaf-hi); }
.co-head-me { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--co-line); color: var(--co-leaf-hi); }
.co-head-me svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.co-head-me:hover { background: var(--co-lac); }
@media (max-width: 900px) {
  .co-head-me { margin-left: auto; }
  .co-menu-btn { margin-left: 8px; }
  .co-lunar-remind { padding: 3px 8px; }
  .co-lunar-today span[data-l-year] { display: none; }
}

/* Chánh điện cao vừa màn hình khi có dải lịch âm */
body.web-mode .co-temple { height: calc(100svh - var(--co-head-h, 60px) - var(--co-strip-h)); }
.admin-bar.web-mode .co-temple { height: calc(100svh - var(--co-head-h, 60px) - var(--co-strip-h) - 32px); }
@media (max-width: 900px) {
  body.web-mode .co-temple { height: auto; }
  body.web-mode .stage-wrapper { height: min(calc(100svh - var(--co-head-h, 60px) - var(--co-strip-h) - var(--bar-h)), calc(100vw * 16 / 9)); }
}

/* ------------------------------------------------------------------ ngày lễ: dải chữ + dây đèn lồng trên sân khấu */
.co-fest-ribbon {
  position: absolute; z-index: 30; top: 46px; left: 50%; transform: translateX(-50%);
  max-width: 92%; padding: 7px 16px;
  background: rgba(122, 26, 18, 0.92); border: 1px solid var(--co-leaf-hi);
  font-family: var(--co-f-head); font-weight: 600; font-size: 14px; color: var(--co-paper);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
body.le-ngay-le .stage-wrapper::before {
  content: ''; position: absolute; z-index: 25; left: 0; right: 0; top: 0; height: 64px; pointer-events: none;
  background:
    radial-gradient(circle at 50% 70%, #ff5a36 0 9px, #b3220f 10px 13px, transparent 14px) 0 0 / 60px 56px repeat-x,
    linear-gradient(180deg, rgba(255, 170, 80, .22), transparent);
  filter: drop-shadow(0 0 8px rgba(255, 120, 60, .6));
  animation: co-lantern-sway 4s ease-in-out infinite alternate;
}
body.le-vu-lan .stage-wrapper::before {
  background: radial-gradient(circle at 50% 70%, #ff8fa3 0 8px, #c2185b 9px 12px, transparent 13px) 0 0 / 54px 56px repeat-x;
}
@keyframes co-lantern-sway { from { transform: translateY(-2px); } to { transform: translateY(3px); } }

/* ------------------------------------------------------------------ cổng vào: lời tặng */
.gate-gift { border: 1px solid var(--leaf, #c9973a); background: rgba(122, 26, 18, .35); padding: 16px 18px; max-width: 380px; }
.gate-gift-h { font-family: var(--f-head, 'Bai Jamjuree'); font-size: 19px; line-height: 1.4; color: var(--paper, #f0e2c2); }
.gate-gift-h strong { color: var(--leaf-hi, #ecc66f); }
.gate-gift-wish { margin-top: 8px !important; font-family: var(--f-body, Roboto); font-size: 15px; line-height: 1.55; color: #e6d5b4; }

/* ------------------------------------------------------------------ bảng hành lễ: phần thêm */
.pp-book {
  display: block; font-family: var(--f-ui); font-size: 13.5px; line-height: 1.45; color: var(--paper);
  text-decoration: none; padding: 10px 12px; border: 1px dashed var(--leaf); background: rgba(122, 26, 18, .25);
}
.pp-book:hover { background: var(--lac); }
.pp-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pp-links a { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--wood); text-decoration: none; }
.pp-links a:hover { background: #3a120c; }
.pp-links strong { font-family: var(--f-head); font-weight: 600; font-size: 14.5px; color: var(--leaf-hi); }
.pp-links span { font-family: var(--f-ui); font-size: 11.5px; line-height: 1.35; color: var(--smoke); }
.pp-joy {
  position: absolute; right: 0; bottom: 10px; font-family: var(--f-ui); font-size: 12px; color: var(--leaf-hi);
  background: none; border: 1px solid rgba(201, 151, 58, .4); padding: 2px 8px; cursor: pointer;
}
.pp-joy.is-on { background: var(--lac); color: var(--paper); border-color: var(--lac); }
.pp-wish { padding-bottom: 34px; }
.pp-wish-for { font-family: var(--f-ui); font-size: 12px; color: var(--smoke); margin-top: 2px; }
.pp-toast-acts { display: flex; gap: 8px; margin-top: 8px; }
.pp-toast-acts a, .pp-toast-acts button {
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--paper); background: var(--lac);
  border: 0; padding: 6px 12px; text-decoration: none; cursor: pointer;
}
.pp-toast { display: flex; flex-direction: column; }
.pp-pop {
  box-sizing: border-box;
  position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(420px, calc(100vw - 20px)); padding: 18px; background: var(--wood);
  border: 1px solid var(--leaf); box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
}
.pp-pop-h { font-family: var(--f-head); font-weight: 600; font-size: 18px; color: var(--paper); margin-bottom: 12px; }
.pp-pop-sub { font-family: var(--f-body); font-size: 14px; line-height: 1.5; color: var(--smoke); margin: -6px 0 12px; }
.pp-pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-pop-grid button, .pp-pop-row button {
  font-family: var(--f-ui); font-size: 14px; color: var(--paper); background: var(--wood-2); border: 1px solid var(--line);
  padding: 12px 10px; cursor: pointer; text-align: left;
}
.pp-pop-grid button:hover, .pp-pop-row button:hover { border-color: var(--leaf-hi); background: #3a120c; }
.pp-pop-row { display: flex; gap: 8px; }
.pp-pop-row button { flex: 1; text-align: center; }
.pp-pop-main { background: var(--leaf-hi) !important; color: var(--lac-deep) !important; font-weight: 600; }
.pp-pop-x { margin-top: 10px; font-family: var(--f-ui); font-size: 13px; background: none; border: 0; color: var(--smoke); text-decoration: underline; cursor: pointer; }
@media (max-width: 900px) {
  .pilgrim-panel .pp-book, .pilgrim-panel .pp-links { display: none; }
  .pilgrim-panel.is-open .pp-book { display: block; order: 4; }
  .pilgrim-panel.is-open .pp-links { display: grid; order: 7; }
}

/* ------------------------------------------------------------------ chung cho trang tính năng */
.co-sapo { font-size: 18px; line-height: 1.7; color: var(--co-muted); margin: 0 0 26px; max-width: 75ch; }
.co-sapo strong { color: var(--co-paper); }
.co-h2 { font-family: var(--co-f-head); font-weight: 600; font-size: 22px; color: var(--co-paper); margin: 0 0 14px; }
.co-btn { border: 0; cursor: pointer; font-size: 15px; }
.co-btn:hover { background: #f4d78f; }
.co-btn-ghost { background: transparent; color: var(--co-leaf-hi); border: 1px solid var(--co-leaf); }
.co-btn-ghost:hover { background: var(--co-wood-3); }
.co-btn-danger { background: transparent; color: #f19a8a; border: 1px solid #9a2618; }
.co-btn-danger:hover { background: #4a0f09; }
.co-btn:disabled { opacity: .55; cursor: wait; }
.co-cta-row, .co-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0; }
.co-app { max-width: 980px; }
.co-app-prose { margin-top: 44px; }
.co-empty { color: var(--co-muted); list-style: none; }
.co-form-msg { min-height: 1.4em; margin: 10px 0 0; font-family: var(--co-f-ui); font-size: 14.5px; color: var(--co-muted); }
.co-form-msg[data-tone=ok] { color: #a8d38a; }
.co-form-msg[data-tone=warn] { color: #f3a08f; }

.co-form-card { border: 1px solid var(--co-line-hi); background: var(--co-wood-2); padding: 22px; margin: 24px 0; }
.co-form { display: flex; flex-direction: column; gap: 14px; }
.co-form-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.co-form-row:first-child { grid-template-columns: 1.6fr 1fr; }
.co-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.co-field > span, .co-field legend { font-family: var(--co-f-ui); font-size: 13px; color: var(--co-muted); padding: 0; }
.co-field input, .co-field select, .co-field textarea {
  width: 100%; font: 400 16px var(--co-f-body); color: var(--co-paper); background: #120604;
  border: 1px solid var(--co-line-hi); padding: 10px 12px;
}
.co-field textarea { resize: vertical; line-height: 1.6; }
.co-field-gio { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.co-field-gio legend { width: 100%; margin-bottom: 6px; }
.co-field-gio select { flex: 1; width: auto; }
.co-form-note { font-size: 14px; color: var(--co-muted); margin: 0; border-left: 2px solid var(--co-leaf); padding-left: 10px; }
.co-photo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.co-photo-pick small { color: var(--co-muted); font-size: 13px; }
.co-photo-preview { width: 64px; height: 80px; border: 1px solid var(--co-line-hi); background: #120604 center / cover no-repeat; }
.co-check { display: inline-flex; align-items: center; gap: 8px; font-family: var(--co-f-ui); font-size: 14px; color: var(--co-text); cursor: pointer; }
.co-seg { display: flex; gap: 0; border: 1px solid var(--co-line-hi); padding: 0; margin: 0; width: fit-content; }
.co-seg label { padding: 9px 18px; font-family: var(--co-f-ui); font-size: 14.5px; cursor: pointer; color: var(--co-text); }
.co-seg input { position: absolute; opacity: 0; }
.co-seg label:has(input:checked) { background: var(--co-lac); color: var(--co-paper); }
.co-seg label:has(input:focus-visible) { outline: 2px solid var(--co-leaf-hi); }

/* ------------------------------------------------------------------ quẻ xăm */
.co-slip-card { display: grid; grid-template-columns: 110px 1fr; margin: 4px 0 30px; border: 1px solid var(--co-leaf); background: var(--co-paper); color: #2e1a0e; }
.co-slip-num { background: var(--co-lac); color: var(--co-paper); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 8px; font-family: var(--co-f-head); }
.co-slip-num span { font-size: 14px; letter-spacing: .08em; }
.co-slip-num strong { font-size: 52px; line-height: 1; }
.co-slip-body { padding: 18px 24px; }
.co-slip-rank { margin: 0; font-family: var(--co-f-ui); font-size: 13px; color: var(--co-lac); font-weight: 600; }
.co-slip-title { margin: 4px 0 12px; font-family: var(--co-f-head); font-weight: 700; font-size: 22px; line-height: 1.3; }
.co-slip-poem { margin: 0; font-family: var(--co-f-head); font-weight: 500; font-size: 19px; line-height: 1.8; }
.co-rank-ha-que .co-slip-num { background: #3b2a22; }
.co-que-group { margin: 34px 0; }
.co-que-h { font-family: var(--co-f-head); font-size: 24px; color: var(--co-leaf-hi); display: flex; align-items: baseline; gap: 12px; margin: 0; }
.co-que-h span { font-family: var(--co-f-ui); font-size: 13px; color: var(--co-muted); font-weight: 400; }
.co-que-desc { color: var(--co-muted); margin: 6px 0 14px; font-size: 15.5px; }
.co-que-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.co-que-grid a { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; padding: 9px 12px 9px 0; border: 1px solid var(--co-line); background: var(--co-wood-2); text-decoration: none; }
.co-que-grid a:hover { border-color: var(--co-leaf-hi); background: var(--co-wood-3); }
.co-que-n { font-family: var(--co-f-head); font-weight: 700; font-size: 20px; color: var(--co-leaf-hi); text-align: center; border-right: 1px solid var(--co-line); }
.co-que-t { font-family: var(--co-f-head); font-size: 14.5px; line-height: 1.35; color: var(--co-paper); }

/* ------------------------------------------------------------------ lịch âm */
.co-today { display: grid; grid-template-columns: auto 1fr; gap: 0; border: 1px solid var(--co-leaf); margin-bottom: 30px; }
.co-today-solar, .co-today-lunar { display: flex; flex-direction: column; justify-content: center; padding: 18px 26px; font-family: var(--co-f-ui); font-size: 14px; color: var(--co-muted); }
.co-today-solar { background: var(--co-lac); color: var(--co-paper); align-items: center; }
.co-today-solar strong { font-family: var(--co-f-head); font-size: 64px; line-height: 1; margin: 4px 0; }
.co-today-lunar strong { font-family: var(--co-f-head); font-size: 40px; line-height: 1.1; color: var(--co-leaf-hi); }
.co-today-lunar em { font-style: normal; color: var(--co-paper); margin-top: 6px; font-family: var(--co-f-head); font-size: 16px; }
.co-today .co-btn { grid-column: 1 / -1; text-align: center; }
.co-cal { margin-bottom: 30px; }
.co-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.co-cal-head h2 { margin: 0; font-family: var(--co-f-head); font-size: 22px; color: var(--co-paper); text-align: center; }
.co-cal-head a { font-family: var(--co-f-ui); font-size: 14px; color: var(--co-leaf-hi); text-decoration: none; white-space: nowrap; }
.co-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--co-line); border: 1px solid var(--co-line); }
.co-cal-wd { background: var(--co-wood-3); padding: 8px 4px; text-align: center; font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-muted); }
.co-cal-pad { background: #120604; }
.co-cal-day { background: var(--co-wood-2); min-height: 76px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.co-cal-day .s { font-family: var(--co-f-head); font-weight: 600; font-size: 20px; color: var(--co-paper); line-height: 1.1; }
.co-cal-day .l { font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-muted); }
.co-cal-day .f { font-family: var(--co-f-ui); font-size: 11px; line-height: 1.25; color: var(--co-leaf-hi); }
.co-cal-day.is-m1 .l, .co-cal-day.is-ram .l { color: #ff8b70; font-weight: 600; }
.co-cal-day.is-ram { background: #2c0f0a; }
.co-cal-day.is-today { outline: 2px solid var(--co-leaf-hi); outline-offset: -2px; background: var(--co-lac); }
.co-upcoming li { margin-bottom: 6px; }
@media (max-width: 640px) {
  .co-today { grid-template-columns: 1fr; }
  .co-cal-day { min-height: 54px; padding: 4px; }
  .co-cal-day .s { font-size: 16px; }
  .co-cal-day .f { display: none; }
  .co-cal-head a { font-size: 12px; }
  .co-cal-head h2 { font-size: 17px; }
}

/* ------------------------------------------------------------------ bàn thờ gia tiên */
.co-mine { margin-bottom: 10px; }
.co-mine-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.co-mine-item { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--co-line-hi); background: var(--co-wood-2); text-decoration: none; }
.co-mine-item:hover { border-color: var(--co-leaf-hi); background: var(--co-wood-3); }
.co-mine-pic { width: 56px; height: 68px; display: grid; place-items: center; background: #2a120c center / cover no-repeat; border: 2px solid var(--co-leaf); font-family: var(--co-f-head); font-size: 26px; color: var(--co-leaf-hi); }
.co-mine-body { display: flex; flex-direction: column; gap: 2px; }
.co-mine-body strong { font-family: var(--co-f-head); font-size: 17px; color: var(--co-paper); }
.co-mine-body span { font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-muted); }

.co-shrine {
  position: relative; overflow: hidden; text-align: center; padding: 34px 20px 24px; margin: 8px 0 24px;
  background: radial-gradient(70% 60% at 50% 30%, #4a170e, #1a0906 70%);
  border: 1px solid var(--co-leaf);
}
.co-shrine-glow { position: absolute; inset: 0; background: radial-gradient(40% 32% at 50% 30%, rgba(255, 190, 90, .22), transparent 70%); pointer-events: none; }
.co-portrait {
  position: relative; width: 168px; height: 212px; margin: 0 auto 18px; padding: 8px;
  background: linear-gradient(135deg, #b8862c, #f1cf7b 45%, #9a6a1f); box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.co-portrait img, .co-portrait-init { display: block; width: 100%; height: 100%; object-fit: cover; background: #2a120c; }
.co-portrait-init { display: grid; place-items: center; font-family: var(--co-f-head); font-size: 76px; color: var(--co-leaf-hi); }
.co-shrine-name { font-family: var(--co-f-head); font-weight: 700; font-size: clamp(26px, 4vw, 36px); color: var(--co-paper); margin: 0; }
.co-shrine-meta { font-family: var(--co-f-ui); font-size: 15px; color: var(--co-muted); margin: 6px 0 0; }
.co-shrine-gio { display: inline-block; margin: 12px 0 0; padding: 5px 14px; border: 1px solid var(--co-leaf); font-family: var(--co-f-ui); font-size: 14px; color: var(--co-leaf-hi); }
.co-shrine-note { max-width: 56ch; margin: 14px auto 0; font-family: var(--co-f-head); font-size: 17px; line-height: 1.6; color: var(--co-text); }
.co-altar-table { position: relative; height: 120px; margin: 26px auto 8px; max-width: 420px; border-bottom: 12px solid #5a1d10; box-shadow: 0 10px 0 #2d0e08; }
.co-bowl { position: absolute; left: 50%; bottom: 0; width: 96px; height: 40px; transform: translateX(-50%); background: linear-gradient(180deg, #e2b860, #8a5a17); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.co-bowl i { position: absolute; left: 50%; bottom: 40px; }
.co-bowl i b { position: absolute; bottom: 0; left: calc(var(--i) * 9px - 1.5px); width: 3px; height: 62px; background: linear-gradient(180deg, #ff8a3d 0 6px, #6b2c18 6px); transform-origin: bottom; transform: rotate(calc(var(--i) * 4deg)); }
.co-bowl i b::after { content: ''; position: absolute; left: -5px; top: -36px; width: 13px; height: 34px; background: radial-gradient(closest-side, rgba(220, 210, 200, .38), transparent); animation: co-smoke 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * .4s); }
@keyframes co-smoke { 0% { opacity: 0; transform: translateY(6px) scaleY(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scaleY(1.3) translateX(4px); } }
.co-vase { position: absolute; bottom: 0; width: 34px; height: 64px; background: linear-gradient(180deg, #c33a24, #7a1a12); clip-path: polygon(30% 0, 70% 0, 70% 20%, 100% 50%, 80% 100%, 20% 100%, 0 50%, 30% 20%); }
.co-vase::before { content: ''; position: absolute; left: -16px; top: -46px; width: 66px; height: 50px; background: radial-gradient(circle at 30% 50%, #ffd0de 0 8px, transparent 9px), radial-gradient(circle at 60% 30%, #ff9ab8 0 9px, transparent 10px), radial-gradient(circle at 75% 65%, #ffe08a 0 8px, transparent 9px), radial-gradient(circle at 45% 75%, #ffb3c6 0 7px, transparent 8px); opacity: .25; transition: opacity .4s; }
.co-vase-l { left: 8%; } .co-vase-r { right: 8%; }
.co-plate { position: absolute; bottom: 0; right: 26%; width: 70px; height: 34px; background: radial-gradient(circle at 25% 35%, #ffb02e 0 11px, transparent 12px), radial-gradient(circle at 55% 30%, #e64a19 0 11px, transparent 12px), radial-gradient(circle at 75% 45%, #8bc34a 0 10px, transparent 11px), radial-gradient(circle at 45% 55%, #ffd54f 0 10px, transparent 11px); opacity: .3; transition: opacity .4s; }
.co-altar.has-flowers .co-vase::before, .co-altar.fx-flower .co-vase::before { opacity: .95; }
.co-altar.has-fruits .co-plate, .co-altar.fx-fruit .co-plate { opacity: 1; }
.co-altar.fx-incense .co-shrine-glow { animation: co-glow 2.4s ease-out; }
@keyframes co-glow { 0% { opacity: 1; } 30% { opacity: 1; background: radial-gradient(50% 40% at 50% 30%, rgba(255, 200, 100, .45), transparent 70%); } 100% { opacity: 1; } }
.co-shrine-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; max-width: 520px; margin: 18px auto 0; background: var(--co-line); border: 1px solid var(--co-line); }
.co-shrine-stats div { background: rgba(15, 5, 4, .7); padding: 10px 6px; }
.co-shrine-stats dt { font-family: var(--co-f-ui); font-size: 12px; color: var(--co-muted); }
.co-shrine-stats dd { margin: 2px 0 0; font-family: var(--co-f-head); font-weight: 700; font-size: 22px; color: var(--co-paper); }
.co-offer { display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--co-line-hi); background: var(--co-wood-2); padding: 20px; }
.co-offer-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--co-line); border: 1px solid var(--co-line); }
.co-offer-btn { font-family: var(--co-f-head); font-weight: 600; font-size: 17px; color: var(--co-paper); background: var(--co-wood); border: 0; padding: 16px 8px; cursor: pointer; }
.co-offer-btn:hover { background: var(--co-wood-3); }
.co-offer-btn.is-main { background: var(--co-lac); }
.co-offer-btn.is-main:hover { background: var(--co-lac-hi); }
.co-offer .co-btn { align-self: flex-start; }
.co-share { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 30px; }
.co-owner { display: flex; gap: 10px; margin-left: auto; }
.co-visit-list { list-style: none; padding: 0; margin: 0; }
.co-visit { padding: 12px 0; border-top: 1px solid var(--co-line); }
.co-visit p { margin: 0; font-size: 15.5px; color: var(--co-text); }
.co-visit strong { color: var(--co-paper); font-family: var(--co-f-head); }
.co-visit time { font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-muted); margin-left: 6px; }
.co-visit blockquote { margin: 8px 0 0; padding: 10px 14px; background: var(--co-paper); color: #2e1a0e; border-left: 4px solid var(--co-lac); font-family: var(--co-f-head); font-size: 16.5px; line-height: 1.6; }
.co-visit.is-new { animation: co-in .5s ease-out; }
@keyframes co-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 700px) {
  .co-form-row, .co-form-row:first-child { grid-template-columns: 1fr; }
  .co-shrine-stats { grid-template-columns: repeat(2, 1fr); }
  .co-owner { margin-left: 0; }
  .co-portrait { width: 140px; height: 176px; }
}

/* ------------------------------------------------------------------ sổ cầu an */
.co-book-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--co-line); border: 1px solid var(--co-line); margin-bottom: 8px; }
.co-book-stats div { background: var(--co-wood-2); padding: 14px 16px; }
.co-book-stats strong { display: block; font-family: var(--co-f-head); font-size: 32px; color: var(--co-leaf-hi); line-height: 1.1; }
.co-book-stats span { font-family: var(--co-f-ui); font-size: 13px; color: var(--co-muted); }
.co-book { margin: 30px 0; }
.co-book-list { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 14px; }
.co-book-item { break-inside: avoid; margin-bottom: 12px; padding: 12px 14px; background: var(--co-paper); color: #2e1a0e; border-left: 4px solid var(--co-lac); }
.co-book-names { margin: 0; font-family: var(--co-f-head); font-weight: 600; font-size: 17px; line-height: 1.4; }
.co-book-note { margin: 4px 0 0; font-size: 14.5px; line-height: 1.5; }
.co-book-meta { margin: 6px 0 0; font-family: var(--co-f-ui); font-size: 12px; color: #7a5a3e; }

/* ------------------------------------------------------------------ tu tập */
.co-tabs { display: flex; border: 1px solid var(--co-line-hi); width: fit-content; margin: 8px 0 22px; }
.co-tabs button { font-family: var(--co-f-head); font-weight: 600; font-size: 16px; padding: 11px 22px; color: var(--co-text); background: transparent; border: 0; cursor: pointer; }
.co-tabs button[aria-selected=true] { background: var(--co-lac); color: var(--co-paper); }
.co-panel { border: 1px solid var(--co-line-hi); background: var(--co-wood-2); padding: 24px; }
.co-beads-wrap { position: relative; width: min(360px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.co-beads { width: 100%; height: 100%; }
.co-beads .bead { fill: #3b1a10; stroke: #8a5a24; stroke-width: 1; transition: fill .2s; }
.co-beads .bead.mother { fill: #7a1a12; }
.co-beads .bead.done { fill: #b8862c; }
.co-beads .bead.cur { fill: #ffe08a; filter: drop-shadow(0 0 6px #ffcc55); }
.co-beads-tap {
  position: absolute; inset: 16%; border-radius: 50%; border: 1px solid var(--co-leaf);
  background: radial-gradient(circle, #3a140c, #1a0906); color: var(--co-paper); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px;
  -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation;
}
.co-beads-tap:active { transform: scale(.98); background: radial-gradient(circle, #4a1a10, #1a0906); }
.co-beads-phrase { font-family: var(--co-f-head); font-size: 15px; color: var(--co-leaf-hi); text-align: center; line-height: 1.3; }
.co-beads-tap strong { font-family: var(--co-f-head); font-size: 56px; line-height: 1; }
.co-beads-sub { font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-muted); }
.co-beads-opts { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: center; margin-top: 18px; }
.co-beads-opts .co-field { min-width: 260px; }
.co-zen { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.co-zen-ring { --p: 0; width: 230px; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, var(--co-wood-2) 88%, transparent 89%), conic-gradient(var(--co-leaf-hi) calc(var(--p) * 360deg), #3b1a10 0); }
.co-zen-ring strong { font-family: var(--co-f-head); font-size: 52px; color: var(--co-paper); }
.co-zen-ring span { font-family: var(--co-f-ui); font-size: 13px; color: var(--co-muted); max-width: 160px; }
.co-zen-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.co-chip { font-family: var(--co-f-ui); font-size: 14px; color: var(--co-text); border: 1px solid var(--co-line-hi); padding: 7px 12px; cursor: pointer; }
.co-chip input { position: absolute; opacity: 0; }
.co-chip:has(input:checked) { background: var(--co-lac); color: var(--co-paper); border-color: var(--co-lac); }
.co-zen-tip { max-width: 56ch; color: var(--co-muted); font-size: 15px; }
.co-sutra-ctrl { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.co-sutra { list-style: none; margin: 0; padding: 18px 22px; background: var(--co-paper); color: #2e1a0e; max-height: 60vh; overflow-y: auto; }
.co-sutra li { font-family: var(--co-f-head); font-size: 19px; line-height: 1.7; padding: 3px 8px; transition: background .3s, color .3s; }
.co-sutra li.is-title { text-align: center; font-weight: 700; color: var(--co-lac); margin-bottom: 8px; }
.co-sutra li.cur { background: var(--co-lac); color: var(--co-paper); }
.co-sutra li.done { color: #9a7b5c; }
@media (max-width: 600px) {
  .co-tabs { width: 100%; }
  .co-tabs button { flex: 1; padding: 11px 6px; font-size: 14.5px; }
  .co-panel { padding: 16px 12px; }
  .co-sutra li { font-size: 17px; }
}

/* ------------------------------------------------------------------ sổ công đức */
.co-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--co-line); border: 1px solid var(--co-line-hi); }
.co-stat { background: var(--co-wood-2); padding: 16px; }
.co-stat strong { display: block; font-family: var(--co-f-head); font-size: 34px; line-height: 1.1; color: var(--co-paper); }
.co-stat span { font-family: var(--co-f-ui); font-size: 13px; color: var(--co-muted); }
.co-stat-streak { background: var(--co-lac); }
.co-stat-streak strong { color: var(--co-leaf-hi); font-size: 44px; }
.co-stat-streak span { color: var(--co-paper); }
.co-today-note { color: var(--co-leaf-hi); font-family: var(--co-f-head); font-size: 17px; margin: 14px 0 0; min-height: 1em; }
.co-card-sec { margin: 30px 0; }
.co-history { list-style: none; margin: 0; padding: 0; }
.co-history li { padding: 10px 0; border-top: 1px solid var(--co-line); }
.co-history-h { margin: 0; font-family: var(--co-f-ui); font-size: 12.5px; color: var(--co-leaf); }
.co-history li p:last-child { margin: 2px 0 0; color: var(--co-text); }
.co-code { font-family: var(--co-f-head); font-weight: 700; font-size: 24px; letter-spacing: .08em; color: var(--co-wood); background: var(--co-leaf-hi); padding: 6px 14px; }
.co-restore { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.co-restore .co-field { width: 260px; }
.co-ios-tip { color: var(--co-muted); font-size: 14px; }
@media (max-width: 640px) {
  .co-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .co-stat strong { font-size: 28px; }
}

/* ------------------------------------------------------------------ thẻ kinh tụng YouTube */
.pp-yt { border: 1px solid var(--line); background: var(--wood); }
.pp-yt-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 0; font-family: var(--f-ui); font-size: 12.5px; color: var(--smoke); }
.pp-yt-dot { width: 7px; height: 7px; flex-shrink: 0; background: var(--smoke); }
.pp-yt.is-playing .pp-yt-dot { background: #6fbf4a; box-shadow: 0 0 0 3px rgba(111, 191, 74, .2); animation: co-pulse 1.6s ease-in-out infinite; }
@keyframes co-pulse { 50% { opacity: .35; } }
.pp-yt.is-playing .pp-yt-h { color: var(--paper); }
/* YouTube yêu cầu khung phát tối thiểu 200x200 */
.pp-yt-frame { position: relative; width: 100%; height: 200px; min-width: 200px; background: #000; }
.pp-yt-frame iframe, .pp-yt-frame > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) {
  body.web-mode .pp-yt { display: none; }
  body.web-mode .pilgrim-panel.is-open .pp-yt { display: block; }
}

/* ------------------------------------------------------------------ phòng nói chuyện */
.pp-voice { border: 1px solid var(--line); background: var(--wood); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pp-voice-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pp-voice-h { font-family: var(--f-head); font-weight: 600; font-size: 16px; color: var(--paper); }
.pp-voice-count { font-family: var(--f-ui); font-size: 12px; color: var(--leaf); }
.pp-voice-sub { font-size: 13.5px; line-height: 1.45; color: var(--smoke); }
.pp-voice[data-state=in] .pp-voice-sub { display: none; }
.pp-voice-row { display: flex; gap: 8px; }
.pp-voice-row button { flex: 1; min-height: 42px; font-family: var(--f-ui); font-size: 14px; border: 1px solid var(--line); background: var(--wood-2); color: var(--paper); cursor: pointer; }
.pp-voice-join { background: var(--lac) !important; border-color: var(--lac) !important; font-weight: 500; }
.pp-voice-mic.is-live, .pp-quick-mic.is-live { background: #2f6b2a !important; border-color: #6fbf4a !important; color: #fff !important; }
.pp-voice-mic:disabled, .pp-quick-mic:disabled { opacity: .6; cursor: not-allowed; }
.pp-voice-hint { font-size: 12.5px; line-height: 1.45; color: var(--smoke); border-left: 2px solid var(--leaf); padding-left: 8px; }
.pp-voice-list { list-style: none; display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.pp-vp { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 4px 8px; padding: 7px 0; border-top: 1px solid rgba(201, 151, 58, .14); }
.pp-vp-dot { width: 8px; height: 8px; background: #4a3a30; }
.pp-vp.is-speaking .pp-vp-dot { background: #6fbf4a; box-shadow: 0 0 0 3px rgba(111, 191, 74, .25); }
.pp-vp-name { font-family: var(--f-head); font-size: 14.5px; color: var(--paper); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-vp-mic { font-family: var(--f-ui); font-size: 11.5px; color: var(--smoke); }
.pp-vp.is-speaking .pp-vp-mic { color: #9fdc7c; }
.pp-vp-acts { grid-column: 2 / -1; display: flex; gap: 6px; }
.pp-vp-btn { font-family: var(--f-ui); font-size: 12px; padding: 4px 9px; min-height: 30px; background: transparent; border: 1px solid var(--line); color: var(--paper); cursor: pointer; }
.pp-vp-btn.is-danger { color: #f3a08f; border-color: #7a1a12; }
.pp-vp-btn.is-quiet { color: var(--smoke); border-color: rgba(201, 151, 58, .2); }
@media (max-width: 900px) {
  body.web-mode .pp-voice { display: none; }
  body.web-mode .pilgrim-panel.is-open .pp-voice { display: flex; order: 4; }
  .pp-vp-btn { min-height: 38px; padding: 6px 12px; }
}
.pp-links a.pp-link-3d { border-color: rgba(240, 196, 106, .7); background: rgba(142, 31, 21, .35); }
