/* Gia Phả Tộc Nguyễn Hồng · Bản quyền © 2026 ThienNV – phông chữ lưu ngay trên trang (CSP chỉ cho phép phông của chính trang): Be Vietnam Pro, Noto Serif, Playfair Display – giấy phép SIL OFL 1.1 */
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 400; src: url(lib/fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 400; src: url(lib/fonts/be-vietnam-pro-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 500; src: url(lib/fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 500; src: url(lib/fonts/be-vietnam-pro-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 600; src: url(lib/fonts/be-vietnam-pro-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 600; src: url(lib/fonts/be-vietnam-pro-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 700; src: url(lib/fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-style: normal; font-display: swap; font-weight: 700; src: url(lib/fonts/be-vietnam-pro-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Serif'; font-style: normal; font-display: swap; font-weight: 400; src: url(lib/fonts/noto-serif-vietnamese-400-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Noto Serif'; font-style: normal; font-display: swap; font-weight: 400; src: url(lib/fonts/noto-serif-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Serif'; font-style: normal; font-display: swap; font-weight: 700; src: url(lib/fonts/noto-serif-vietnamese-700-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Noto Serif'; font-style: normal; font-display: swap; font-weight: 700; src: url(lib/fonts/noto-serif-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Noto Serif'; font-style: italic; font-display: swap; font-weight: 400; src: url(lib/fonts/noto-serif-vietnamese-400-italic.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Noto Serif'; font-style: italic; font-display: swap; font-weight: 400; src: url(lib/fonts/noto-serif-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-display: swap; font-weight: 600; src: url(lib/fonts/playfair-display-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-display: swap; font-weight: 600; src: url(lib/fonts/playfair-display-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-display: swap; font-weight: 700; src: url(lib/fonts/playfair-display-vietnamese-700-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-display: swap; font-weight: 700; src: url(lib/fonts/playfair-display-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-display: swap; font-weight: 400; src: url(lib/fonts/playfair-display-vietnamese-400-italic.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-display: swap; font-weight: 400; src: url(lib/fonts/playfair-display-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  --paper: #f5eee2; --panel: #fffbf4; --ink: #2b1c15; --muted: #7b685b; --line: #e6d7bf; --line2: #f0e5d3;
  --lac: #7d1f16; --lac2: #a2301f; --lac-soft: #f8e6df; --gold: #a97a22; --gold2: #c99a3c; --gold-soft: #f6ead0;
  --ok: #2f7a45; --ok-soft: #e4f2e7; --warn: #9a6100; --warn-soft: #fff1d6; --err: #b3261e; --err-soft: #fbe7e5; --info: #3a5f8a; --info-soft: #e6eef7;
  --side: #3a110d; --side2: #4d1812; --side-ink: #f1dfc6; --side-active: #5f2018;
  --radius: 12px; --shadow: 0 1px 2px rgba(60, 25, 10, .06), 0 6px 20px rgba(60, 25, 10, .06);
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --display: "Playfair Display", "Noto Serif", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16100d; --panel: #201713; --ink: #f1e7da; --muted: #b29f8d; --line: #3b2c23; --line2: #2b201a;
    --lac: #ec8d79; --lac2: #f2a593; --lac-soft: #3a1c16; --gold: #e0b866; --gold2: #ecc97e; --gold-soft: #33281a;
    --ok: #7fd197; --ok-soft: #17291c; --warn: #f0b84a; --warn-soft: #2e2412; --err: #ff8a80; --err-soft: #321816; --info: #94b8e6; --info-soft: #18222f;
    --side: #110a08; --side2: #1b100d; --side-ink: #e9d8c1; --side-active: #3a1a13; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16100d; --panel: #201713; --ink: #f1e7da; --muted: #b29f8d; --line: #3b2c23; --line2: #2b201a;
  --lac: #ec8d79; --lac2: #f2a593; --lac-soft: #3a1c16; --gold: #e0b866; --gold2: #ecc97e; --gold-soft: #33281a;
  --ok: #7fd197; --ok-soft: #17291c; --warn: #f0b84a; --warn-soft: #2e2412; --err: #ff8a80; --err-soft: #321816; --info: #94b8e6; --info-soft: #18222f;
  --side: #110a08; --side2: #1b100d; --side-ink: #e9d8c1; --side-active: #3a1a13; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--font); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
body { -webkit-text-size-adjust: 100%; }
body.noscroll { overflow: hidden; }
a { color: var(--lac2); }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.3; font-family: var(--serif); font-weight: 700; color: var(--ink); letter-spacing: .005em; }
h1 { font-size: 22px; } h2 { font-size: 18.5px; } h3 { font-size: 16px; color: var(--lac); }
/* tiêu đề khung: hoa văn hình thoi vàng */
.card > h2, .card-h h2, .dlg-h h2 { display: flex; align-items: center; gap: 10px; }
.card > h2::before, .card-h h2::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--gold2); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--gold-soft); }
.card > h2.center { justify-content: center; }
p { margin: .35em 0 .7em; }
.pad { padding: 24px; } .m0 { margin: 0; } .mt { margin-top: 22px; }
.boot { padding: 60px 20px; text-align: center; color: var(--muted); font: italic 17px var(--serif); }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; } .center { text-align: center; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.hide { display: none !important; } [hidden] { display: none !important; }
.big { font-size: 17px; } .grow { flex: 1; min-width: 0; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---------- khung ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--side), var(--side2)); color: var(--side-ink); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; cursor: pointer; border-bottom: 1px solid rgba(255, 220, 170, .14); margin-bottom: 8px; }
.brand b { display: block; color: #fff3df; font: 700 18px/1.2 var(--display); letter-spacing: .02em; }
.brand small { display: block; color: #d7b98a; font: italic 12px/1.35 var(--serif); margin-top: 2px; }
.seal { width: 40px; height: 40px; border-radius: 8px; background: #a02a1c; border: 2px solid #d9ae5c; color: #ffe9b8; display: grid; place-items: center; font: 700 15px var(--display); letter-spacing: .04em; flex: none; box-shadow: inset 0 0 0 2px #7d1f16; }
.nav { flex: 1; }
.nav button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; padding: 8px 10px; border-radius: 8px; font: 500 14.5px var(--font); text-align: left; cursor: pointer; }
.nav button:hover { background: rgba(255, 230, 190, .08); }
.nav button.on { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #d9ae5c; }
.nav button.locked { opacity: .62; }
.nav .grp { font: 600 10.5px var(--font); text-transform: uppercase; letter-spacing: .18em; color: #c9a56b; padding: 16px 10px 5px; }
.nav .badge, .nav .lock { margin-left: auto; }
.badge { background: #d9ae5c; color: #3a110d; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.side-foot { padding: 10px 4px 0; border-top: 1px solid rgba(255, 220, 170, .14); }
.side-foot .btn { color: var(--side-ink); border-color: rgba(255, 220, 170, .25); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 500; }
.top .title { margin: 0; font: 700 22px var(--display); letter-spacing: .01em; color: var(--lac); }
.sp { flex: 1; }
.content { padding: 20px 22px; max-width: 1280px; width: 100%; }
.foot { padding: 16px 22px 30px; color: var(--muted); font-size: 12px; margin-top: auto; }
.menu-btn { display: none; }
.chip { display: flex; align-items: center; gap: 8px; }
.chip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--lac); color: #fff; display: grid; place-items: center; font-weight: 700; }
:root[data-theme="dark"] .chip .av { color: #2b1c15; }
.chip .who { display: flex; flex-direction: column; line-height: 1.2; }
.chip .who b { font-size: 13.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .who small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 1000; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px 16px; }
  .top { padding: 8px 12px; }
  .chip .who { display: none; }
  .foot { padding: 16px; }
}

/* ---------- thành phần ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.p0 { padding: 0; overflow: auto; }
.card-h { display: flex; align-items: baseline; gap: 10px; } .card-h h2 { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; flex-wrap: wrap; } .row.center { justify-content: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label, .grid2 label, .grid3 label, .grid4 label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid2.gap { gap: 16px; } .grid2.gap > .card { margin-bottom: 0; } .grid2.gap { margin-bottom: 16px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold2); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--lac); }
.w4 { width: 70px; } .w6 { width: 90px; }
label.check { flex-direction: row !important; align-items: center; gap: 8px; color: var(--ink) !important; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0 6px; color: var(--ink); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 9px; padding: 8px 14px; font: 600 14.5px var(--font); letter-spacing: .005em; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--gold2); }
.btn.pri { background: var(--lac); border-color: var(--lac); color: #fff8ec; }
:root[data-theme="dark"] .btn.pri { color: #1d120e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.pri { color: #1d120e; } }
.btn.pri:hover { background: var(--lac2); }
.btn.danger { color: var(--err); border-color: var(--err-soft); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13.5px; } .btn.block { width: 100%; padding: 11px; }
.btn[data-busy] { opacity: .6; pointer-events: none; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: 5px; border-radius: 7px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--line2); color: var(--ink); }
.link { border: 0; background: none; color: var(--lac2); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-align: left; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--line2); color: var(--muted); font-weight: 600; white-space: nowrap; }
.tag.gold, .tag.le { background: var(--gold-soft); color: var(--gold); } .tag.hot, .tag.gio, .tag.hieu { background: var(--lac-soft); color: var(--lac); }
.tag.warm, .tag.event, .tag.thongbao, .tag.next { background: var(--warn-soft); color: var(--warn); } .tag.ok, .tag.hy, .tag.done { background: var(--ok-soft); color: var(--ok); }
.tag.err { background: var(--err-soft); color: var(--err); } .tag.now, .tag.admin { background: var(--lac); color: #fff; } .tag.tham, .tag.tin, .tag.editor, .tag.dev { background: var(--info-soft); color: var(--info); } .tag.treasurer { background: var(--gold-soft); color: var(--gold); }
.banner { padding: 10px 22px; font-size: 14px; border-bottom: 1px solid var(--line); line-height: 1.8; }
.banner .btn, .banner .link { margin-left: 6px; }
@media (max-width: 900px) { .banner { padding: 8px 16px; } }
.banner.info { background: var(--info-soft); } .banner.warn { background: var(--warn-soft); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty.loading { padding: 22px 10px; } .empty.loading p { margin: 6px 0 0; font-style: italic; }
.spin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--lac); color: #fff8ec; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: var(--panel); color: var(--muted); }
.search input { border: 0; padding: 7px 2px; outline: none; width: 180px; background: transparent; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.list li:last-child { border-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat b { font: 700 27px/1.2 var(--display); color: var(--lac); font-variant-numeric: lining-nums tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--line2); position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl.compact td { padding: 5px 0; } .tbl .n, .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--gold-soft); }
.eyebrow { font: 600 11.5px var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin: 0 0 6px; }
details summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.video { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; margin-top: 8px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- trang chủ ---------- */
.hero { position: relative; display: flex; gap: 20px; align-items: center; background: radial-gradient(120% 140% at 85% 30%, #8f2a1c 0%, #5c1711 45%, #3a0f0b 100%); color: #f7e6c8; border-radius: 16px; padding: 26px 28px; margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(217, 174, 92, .45); border-radius: 11px; pointer-events: none; }
.hero-in { flex: 1; position: relative; }
.hero .eyebrow { color: #d9ae5c; }
.hero-t { font: 700 42px/1.15 var(--display); color: #ffe9bd; margin: 6px 0 4px; letter-spacing: .015em; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.hero-t::after { content: ""; display: block; width: 140px; height: 2px; margin-top: 12px; background: linear-gradient(90deg, #d9ae5c, rgba(217, 174, 92, 0)); }
.motto { font: italic 400 20px/1.4 var(--display); color: #ebcd8f; margin: 0 0 10px; letter-spacing: .01em; }
.intro { max-width: 660px; color: #f3dfc0; font: 15.5px/1.7 var(--serif); }
.altar { position: relative; width: 120px; height: 150px; flex: none; }
.altar .bowl { position: absolute; bottom: 0; left: 20px; width: 80px; height: 40px; background: linear-gradient(#d9ae5c, #8a5f1a); border-radius: 6px 6px 40px 40px; }
.altar .stick { position: absolute; bottom: 36px; left: 59px; width: 2px; height: 70px; background: #c0392b; transform-origin: bottom; }
.altar .stick.l { transform: rotate(-10deg); } .altar .stick.r { transform: rotate(10deg); }
.altar .stick::after { content: ""; position: absolute; top: -3px; left: -1px; width: 4px; height: 4px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 8px 2px #ff8a3d; }
.smoke { position: absolute; bottom: 104px; left: 52px; width: 14px; height: 28px; border-radius: 50%; background: rgba(255, 245, 230, .35); filter: blur(5px); animation: smoke 4s infinite ease-out; }
.smoke.s2 { animation-delay: 1.3s; left: 56px; } .smoke.s3 { animation-delay: 2.6s; left: 48px; }
@keyframes smoke { 0% { transform: translateY(0) scale(.6); opacity: .8; } 100% { transform: translate(10px, -90px) scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .smoke { animation: none; opacity: .3; } }
@media (max-width: 700px) { .hero { padding: 22px 20px; } .hero-t { font-size: 30px; } .motto { font-size: 17px; } .altar { display: none; } }
.duty-now { padding: 4px 0 8px; border-bottom: 1px dashed var(--line); margin-bottom: 8px; } .duty-now:last-child { border-bottom: 0; }
.now-card { border-color: var(--gold2); background: linear-gradient(135deg, var(--panel), var(--gold-soft)); }
.seedcard { border: 2px dashed var(--gold2); }

/* ---------- lịch thủ bổn ---------- */
.tb-wrap { overflow-x: auto; }
.tb-list { display: none; list-style: none; padding: 0; margin: 0; }
.tb-list li { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--line2); cursor: pointer; border-radius: 8px; }
.tb-list li .yr { font: 700 17px var(--serif); width: 48px; flex: none; }
.tb-list li.done { opacity: .6; } .tb-list li.now { background: var(--lac); color: #fff6e6; } .tb-list li.now .muted { color: #f6dcb0; }
.tb-list li.plan { border: 1px dashed var(--line); }
@media (max-width: 700px) { .tb-wrap { display: none; } .tb-list { display: block; } }
.tb { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 640px; table-layout: fixed; }
.tb th { font: 700 16.5px var(--display); color: var(--lac); padding: 8px 4px 10px; border-bottom: 2px double var(--gold2); letter-spacing: .01em; }
.tb td { vertical-align: top; }
.cell { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; cursor: pointer; display: table-cell; transition: transform .1s, box-shadow .1s; }
.cell:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--gold2); }
.cell .yr { display: block; font: 700 18px var(--display); font-variant-numeric: lining-nums; }
.cell .ho { display: block; font: 700 15px var(--serif); }
.cell small { display: block; font-size: 12px; color: var(--muted); }
.cell .nh { color: var(--gold); }
.cell.done { background: var(--line2); opacity: .85; }
.cell.now { background: var(--lac); color: #fff6e6; border-color: var(--lac); box-shadow: 0 0 0 3px var(--gold-soft); }
.cell.now small, .cell.now .nh { color: #f6dcb0; }
.cell.plan { border-style: dashed; background: transparent; }
.cell.dev { box-shadow: inset 0 -3px 0 var(--info); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -2px; margin-right: -6px; }
.lg.done { background: var(--line2); } .lg.now { background: var(--lac); } .lg.next { background: var(--panel); } .lg.plan { border-style: dashed; } .lg.dev { box-shadow: inset 0 -3px 0 var(--info); }
.rule { margin: 18px 0 0; padding: 14px 20px; border-left: 3px solid var(--gold2); background: var(--gold-soft); border-radius: 0 10px 10px 0; font: italic 15.5px/1.75 var(--serif); }
.rule footer { text-align: right; font: 600 15px var(--display); font-style: normal; margin-top: 8px; color: var(--lac); }
.tasks { list-style: none; padding: 0; margin: 0 0 8px; } .tasks li { padding: 4px 0; }

/* ---------- giỗ chạp ---------- */
.list.cal li { padding: 10px 14px; }
.list.cal .mhead { background: var(--line2); font: 600 12px var(--font); letter-spacing: .14em; color: var(--lac); padding: 6px 14px; text-transform: uppercase; letter-spacing: .05em; }
.dbox { width: 64px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 4px 0; background: var(--panel); }
.dbox b { display: block; font: 700 22px var(--display); color: var(--lac); line-height: 1.15; font-variant-numeric: lining-nums; }
.dbox small { font-size: 11px; color: var(--muted); }
.k-gio .dbox { border-color: var(--lac2); }

/* ---------- gia phả ---------- */
.treebox { overflow: auto; background: var(--panel) radial-gradient(circle, var(--line2) 1px, transparent 1px) 0 0 / 22px 22px; border: 1px solid var(--line); border-radius: var(--radius); height: 70vh; cursor: grab; touch-action: pan-x pan-y; }
.treebox.drag { cursor: grabbing; user-select: none; }
#treesvg { display: block; }
.edges path { fill: none; stroke: var(--gold2); stroke-width: 1.6; }
.node { cursor: pointer; }
.node > rect { fill: var(--panel); stroke: var(--line); stroke-width: 1.2; }
.node.m > rect { stroke: #8fa9c9; } .node.f > rect { stroke: #d9a0a0; }
.node.dead > rect { fill: var(--gold-soft); stroke: var(--gold2); }
.node:hover > rect { stroke: var(--lac); stroke-width: 2; }
.node.hit > rect { stroke: var(--lac); stroke-width: 3; fill: var(--lac-soft); }
.node.me > rect { stroke: var(--ok); stroke-width: 3; }
.node text { font: 12px var(--font); fill: var(--ink); }
.node text.n { font: 700 13.5px var(--serif); letter-spacing: .005em; } .node text.g, .node text.y { font-size: 11px; fill: var(--muted); }
.node text.more { font-size: 11px; fill: var(--lac); text-anchor: middle; }
.tog rect { fill: var(--line2); stroke: var(--line); } .tog text { font: 700 13px var(--font); text-anchor: middle; fill: var(--ink); }
.profile p { margin: .3em 0; }
.pf-h { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.badge-gen { background: var(--lac); color: #fff6e6; border-radius: 10px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.kin { background: var(--ok-soft); border-radius: 9px; padding: 8px 12px; }
.bio { background: var(--line2); border-radius: 9px; padding: 8px 12px; margin-top: 8px; font-size: 14px; }
.kin-res { background: var(--gold-soft); border: 1px solid var(--gold2); border-radius: 12px; padding: 14px 18px; margin-top: 12px; }
.kin-res b { color: var(--lac); font: 700 22px var(--display); }
.phaky .pk { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; margin-bottom: 6px; }
.phaky .pk p { margin: .15em 0; }

/* ---------- tưởng niệm ---------- */
.memorial-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; } .memorial-top p { flex: 1; min-width: 260px; margin: 0; font: italic 16px/1.75 var(--serif); }
.gen-h { display: flex; align-items: center; gap: 14px; margin: 24px 0 12px; color: var(--lac); font: 700 19px var(--display); letter-spacing: .02em; }
.gen-h::before, .gen-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold2)); }
.gen-h::after { background: linear-gradient(90deg, var(--gold2), transparent); }
.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mem { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 16px 10px 12px; border-radius: 12px 12px 6px 6px; border: 1px solid var(--gold2); background: linear-gradient(180deg, var(--gold-soft), var(--panel)); color: var(--ink); font: inherit; cursor: pointer; position: relative; }
.mem::before { content: ""; position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px; border: 1px solid var(--line); border-radius: 9px 9px 4px 4px; pointer-events: none; }
.mem:hover { box-shadow: var(--shadow); border-color: var(--lac2); }
.mem-n { font: 700 17px/1.3 var(--display); color: var(--lac); } .mem-t { font-size: 12px; color: var(--gold); } .mem-y, .mem-g { font-size: 12.5px; color: var(--muted); } .mem-i { font-size: 12.5px; margin-top: 4px; color: var(--lac2); }
.altar-big { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; border-radius: 12px; background: radial-gradient(circle at 50% 30%, #6b1d14, #2c0b08); }
.tablet { background: linear-gradient(#a8311f, #7a1f16); border: 3px solid #d9ae5c; color: #ffe9bd; border-radius: 40px 40px 6px 6px; padding: 18px 22px 14px; text-align: center; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.tablet b { font: 700 21px/1.3 var(--display); letter-spacing: .02em; } .tablet small { font-size: 12px; color: #f0cf91; }
.censer { position: relative; width: 120px; height: 90px; }
.censer .pot { position: absolute; bottom: 0; left: 20px; width: 80px; height: 36px; background: linear-gradient(#d9ae5c, #8a5f1a); border-radius: 6px 6px 40px 40px; }
.sticks { position: absolute; bottom: 32px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.sticks i { display: block; width: 2px; height: 52px; background: #c0392b; position: relative; }
.sticks i::after { content: ""; position: absolute; top: -3px; left: -1px; width: 4px; height: 4px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 8px 2px #ff8a3d; }
.sticks i::before { content: ""; position: absolute; top: -26px; left: -6px; width: 14px; height: 24px; border-radius: 50%; background: rgba(255, 245, 230, .35); filter: blur(5px); animation: smoke 4s infinite ease-out; }
.sticks i:nth-child(2)::before { animation-delay: 1.3s; } .sticks i:nth-child(3)::before { animation-delay: 2.6s; }
.altar-big.lit .tablet { box-shadow: 0 0 30px 4px rgba(255, 180, 80, .45); transition: box-shadow 1s; }
.tributes { list-style: none; padding: 0; } .tributes li { border-bottom: 1px dashed var(--line); padding: 6px 0; } .tributes p { margin: 0; font: italic 15px/1.7 var(--serif); }

/* ---------- khuyến học, album, mộ, danh bạ ---------- */
.honor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.honor { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold2); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.honor .medal { color: var(--gold); } .honor .icon-btn { position: absolute; top: 6px; right: 6px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.album figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; }
.album img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.album figcaption { font-size: 12.5px; padding: 6px 8px; }
.photo-full img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: #000; }
.mapbox { height: 340px; z-index: 0; }
.grave-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; } .grave-list .card { margin: 0; }
.units { list-style: none; padding-left: 0; } .units ul { list-style: none; padding-left: 18px; border-left: 1px dashed var(--line); margin: 4px 0 4px 8px; } .units li { padding: 3px 0; }
.units [class^="u-"] { font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--line2); color: var(--muted); }
.post h2 { margin: 8px 0; font: 700 22px/1.3 var(--display); color: var(--lac); }
.post > div { font: 15.5px/1.75 var(--serif); }
.lockpage { padding: 40px 20px; } .lockpage p { max-width: 520px; margin: 10px auto 16px; }

/* ---------- hộp thoại, thông báo ---------- */
.modal { position: fixed; inset: 0; background: rgba(30, 10, 5, .5); z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow: auto; }
.dlg { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); border-top: 4px solid var(--lac); }
.dlg.wide { max-width: 780px; }
.dlg-h { display: flex; align-items: center; padding: 14px 18px 4px; } .dlg-h h2 { flex: 1; margin: 0; }
.dlg-b { padding: 8px 18px 18px; }
.dlg h3 { margin-top: 14px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #2b1c15; color: #fff3e0; padding: 10px 18px; border-radius: 10px; z-index: 3000; max-width: 92vw; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); }
.toast.err { background: var(--err); color: #fff; }
.netbar { position: fixed; left: 0; right: 0; top: 0; z-index: 3100; background: var(--err); color: #fff; text-align: center; padding: 8px 16px; font-size: 15px; line-height: 1.5; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.guard { margin-top: 16px; }
@media (max-width: 700px) { .modal { padding: 0; } .dlg { border-radius: 0; min-height: 100vh; max-width: none; } }

/* ---------- mời cài lên màn hình chính ---------- */
.side-foot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.install { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1500; width: min(560px, calc(100vw - 24px)); display: grid; grid-template-columns: 52px 1fr; gap: 6px 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--gold2); border-top: 4px solid var(--lac); border-radius: 14px; padding: 14px 16px; box-shadow: 0 16px 50px rgba(40, 10, 5, .35); animation: rise .35s ease-out; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.install-ic { width: 52px; height: 52px; border-radius: 12px; grid-row: span 2; }
.install-t b { display: block; font: 700 17px var(--display); color: var(--lac); }
.install-t span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.install-b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.install-how { text-align: left; } .install-how .big-ic { display: block; width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 10px; box-shadow: var(--shadow); }
.steps { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--line2); border-radius: 10px; padding: 10px 12px; line-height: 1.55; }
.steps .ic { vertical-align: -4px; color: var(--info); }
.st-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--lac); color: #fff6e6; display: grid; place-items: center; font: 700 14px var(--display); }
.mini-ic { width: 20px; height: 20px; border-radius: 5px; vertical-align: -5px; }
@media (max-width: 700px) { .install { bottom: 10px; padding: 12px; } }
@media print { .install { display: none !important; } }

/* ---------- chữ to, ảnh, lịch sử, đinh suất, đăng ký, QR, in cây ---------- */
.content, .dlg-b, .install { zoom: var(--z, 1); }
.fs-btn { font-family: var(--display); padding: 4px 9px; } .fs-btn span { font-size: 1.3em; margin-left: 1px; }
.zoomed .fs-btn { background: var(--gold-soft); border-color: var(--gold2); }
.av-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold2); }
.av-img.big { width: 96px; height: 96px; }
.pf-photo { float: right; margin: 0 0 8px 12px; }
.mem-ph { width: 76px; height: 92px; object-fit: cover; border-radius: 40px 40px 8px 8px; border: 2px solid var(--gold2); margin-bottom: 6px; }
.tablet-ph { width: 110px; height: 136px; object-fit: cover; border-radius: 55px 55px 8px 8px; border: 3px solid #d9ae5c; align-self: center; margin-bottom: 6px; }
.hist { list-style: none; padding: 0; } .hist li { border-bottom: 1px dashed var(--line); padding: 8px 0; } .hist .row { margin: 0; flex-wrap: wrap; }
.err-list { border-color: var(--err); background: var(--err-soft); } .err-list ul { margin: 0; padding-left: 18px; }
.rsvp { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
tr.paid td { background: var(--ok-soft); }
.qr-poster { text-align: center; padding: 10px; } .qr-poster h2 { font: 700 28px var(--display); color: var(--lac); margin: 4px 0; justify-content: center; }
.qr-poster .motto-p { font: italic 17px var(--display); color: var(--gold); margin: 0 0 12px; }
.qr-box { width: 240px; max-width: 70vw; margin: 8px auto 12px; padding: 10px; background: #fff; border: 3px solid var(--lac); border-radius: 12px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-steps { text-align: left; max-width: 420px; margin: 8px auto; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  body.print-tree .treebox { height: auto !important; overflow: visible !important; border: 0 !important; background: none !important; }
  body.print-tree #treesvg { transform: none !important; width: 100% !important; height: auto !important; }
  body.print-tree .node .tog { display: none; }
  body.print-qr #app, body.print-qr .dlg-h, body.print-qr .noprint, body.print-qr #toast, body.print-qr .install { display: none !important; }
  body.print-qr .modal { position: static; background: none; padding: 0; display: block; overflow: visible; }
  body.print-qr .dlg { box-shadow: none; border: 0; max-width: none; min-height: 0; }
  .content, .dlg-b { zoom: 1; }
}

/* ---------- bản đồ dòng họ, công đức, quỹ thành phần, dâng lễ, bảng tin, mạng xã hội ---------- */
.mapbox.tall { height: 460px; } @media (max-width: 700px) { .mapbox.tall { height: 360px; } }
.pin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); vertical-align: -1px; }
.pin-l { gap: 6px !important; }
.pin-ic i { display: block; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; box-shadow: var(--shadow); }
.qbtn span { font-size: 26px; line-height: 1; } .qbtn:hover { border-color: var(--gold2); transform: translateY(-1px); }
@media (max-width: 700px) { .quick { grid-template-columns: repeat(3, 1fr); } }
.pools { display: grid; gap: 8px; margin-bottom: 12px; }
.pool { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px 36px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; position: relative; }
.pool input { position: absolute; left: 12px; top: 13px; } .pool b { font-family: var(--serif); } .pool small { color: var(--muted); }
.pool.on { border-color: var(--lac); background: var(--lac-soft); }
.cd-qr { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; } .cd-qr .qr-box { width: 220px; margin: 0; }
.cd-info p { margin: .25em 0; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; }
@media (max-width: 700px) { .cd-qr { grid-template-columns: 1fr; } .cd-qr .qr-box { margin: 0 auto; } }
.cd-intro p { margin: 0; font: italic 16px/1.7 var(--serif); }
.warnbox { border-color: var(--warn); background: var(--warn-soft); }
.pool-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 8px; }
.pool-cards .stat b { font-size: 21px; } .pool-cards .stat small { font-size: 11.5px; }
.pool-cards .pool-chung { border-top: 3px solid var(--lac); } .pool-cards .pool-khuyenhoc { border-top: 3px solid var(--gold2); } .pool-cards .pool-hieuhy { border-top: 3px solid #6b6157; } .pool-cards .pool-thamom { border-top: 3px solid var(--info); } .pool-cards .pool-huongkhoi { border-top: 3px solid var(--ok); }
@media (max-width: 900px) { .pool-cards { grid-template-columns: 1fr 1fr; } }
.offers { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.offer-show { text-align: center; font-size: 30px; letter-spacing: 10px; min-height: 8px; }
.composer textarea { flex: 1; } .composer .row { align-items: flex-start; }
.fd-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.post-f .fd-text { font: 15.5px/1.7 var(--font); white-space: normal; }
.fd-photo { width: 100%; max-height: 520px; object-fit: cover; border-radius: 10px; margin: 6px 0; }
.av-ph { width: 44px; height: 44px; border-radius: 50%; background: var(--lac); color: #fff6e6; display: grid; place-items: center; font: 700 18px var(--display); flex: none; }
.fd-act { margin: 6px 0 0; } .cmts { list-style: none; padding: 0; margin: 8px 0; } .cmts li { padding: 4px 0; border-bottom: 1px dashed var(--line2); }
.socs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.soc { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 10px; text-decoration: none; color: #fff; }
.soc.fb { background: #1877f2; } .soc.zl { background: #0068ff; } .soc.tt { background: #111; } .soc.ig { background: #c13584; } .soc.web { background: var(--muted); }

/* ---------- tự động ghi nhận, bài nhúng, fanpage ---------- */
.auto-on { background: var(--ok-soft); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; }
.embed { margin: 8px 0; } .embed iframe { border: 0; border-radius: 10px; background: var(--line2); display: block; }
.fbpage { display: flex; justify-content: center; } .fbpage iframe { width: 100%; max-width: 500px; height: 640px; border: 0; border-radius: 10px; }

/* chữ số thẳng hàng cho phông Playfair (thuộc tính font: viết gọn đặt lại về số kiểu cổ) */
.st-n, .install-t b, .gen-h, .rule footer, .top .title, .hero-t, .motto, .mem-n, .tablet b, .tb th, .post h2, .kin-res b, .brand b, .seal, h1, h2, h3 { font-variant-numeric: lining-nums; }

/* ---------- in ---------- */
@media print {
  .side, .top, .foot, .banner, .netbar, .row, .legend, .stats, .now-card, .no-print { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .card { border: 0; padding: 0; }
  .grid2.gap > .card:not(.print-area) { display: none; }
  .content > :not(.print-area):not(.grid2) { display: none !important; }
  .card > h2::before, .card-h h2::before { display: none; }
  .cell { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; }
  .cell.now { font-weight: 700; border: 2px solid #000 !important; } .cell.now small { color: #333 !important; }
  .tb { min-width: 0; }
  .tb-list { display: none !important; } .tb-wrap { display: block !important; }
}

.update-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9999; background: var(--panel); color: var(--ink); border: 1px solid var(--gold); border-radius: 12px; padding: 8px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px); }
.map-hint { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 240px; font-size: 13px; line-height: 1.4; box-shadow: var(--shadow); }
.cd-warn { background: var(--warn-soft); color: var(--ink); border-left: 4px solid var(--warn); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 14px; } .cd-warn ul { margin: 4px 0 0; padding-left: 18px; } .cd-warn li { margin: 2px 0; } .cd-warn .mono { word-break: break-all; }

/* bản đồ kiểu Google */
.map-btn { width: 40px; height: 40px; border: 0; border-radius: 8px; background: #fff; color: #444; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 19px; line-height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.map-btn:hover { color: #1a73e8; } .map-btn.busy { color: #1a73e8; animation: mapPulse 1s infinite; }
@keyframes mapPulse { 50% { opacity: .45; } }
.leaflet-bottom.leaflet-right .map-btn { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 26px; }
.mapbox.map-full { position: fixed !important; inset: 0; height: 100% !important; z-index: 1000; border-radius: 0; }
.pin-menu { display: flex; flex-direction: column; gap: 6px; min-width: 190px; } .pin-menu small { color: var(--muted); }
.pin-menu .btn { width: 100%; justify-content: center; }
input.flash { animation: flashIn 1.4s; } @keyframes flashIn { 0%, 60% { background: var(--gold-soft); } }

/* hương trầm cao cấp */
.tram-box { margin: 14px 0 6px; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold-soft); text-align: center; }
.tram-box h3 { margin: 0 0 4px; } .tram-in { width: 76px; text-align: center; }
.btn.gold { background: linear-gradient(180deg, #e2b85a, #b8892f); color: #2b1a05; border-color: #a77a22; font-weight: 700; }
.tram-box .cd-qr { text-align: left; margin-top: 10px; } .tram-ok { color: var(--ok); font-size: 15px; }
.altar-big.tram .sticks i { background: linear-gradient(#f3d48a, #b8892f); width: 3px; }
.altar-big.tram .sticks i::after { background: #ffd36b; box-shadow: 0 0 12px 4px #ffbf3d; }
.altar-big.tram .tablet { box-shadow: 0 0 40px 8px rgba(255, 200, 90, .6); }

/* hôm nay + lịch + thời tiết + tin */
.today { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; cursor: pointer; }
.today-sol, .today-lun { display: flex; flex-direction: column; } .today-sol { text-align: center; min-width: 84px; padding-right: 14px; border-right: 1px solid var(--line); }
.today-sol b { font-family: var(--display); font-size: 46px; line-height: 1; color: var(--lac); } .today-lun b { font-size: 22px; color: var(--gold); }
.today small.ok { color: var(--ok); } .today small.bad { color: var(--err); } .today-wx { min-width: 200px; }
@media (max-width: 700px) { .today { grid-template-columns: auto 1fr; } .today-wx { grid-column: 1 / -1; } }
.wx-now { display: flex; gap: 10px; align-items: center; } .wx-ic { font-size: 34px; } .wx-t { font-size: 34px; font-weight: 700; }
.wx-days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; } .wx-d { display: flex; flex-direction: column; align-items: center; background: var(--paper); border-radius: 10px; padding: 6px 2px; font-size: 13px; } .wx-d span { font-size: 22px; }
.wx-alert { margin-top: 8px; background: var(--warn-soft); border-left: 4px solid var(--warn); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.place-line { margin-bottom: 8px; gap: 8px; }
.lich-big { display: flex; align-items: baseline; gap: 12px; } .lich-big b { font-family: var(--display); font-size: 56px; color: var(--lac); line-height: 1; }
.lich-dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 12px 0 0; } .lich-dl dt { color: var(--muted); } .lich-dl dd { margin: 0; }
@media (max-width: 700px) { .lich-dl { grid-template-columns: 1fr; } .lich-dl dt { margin-top: 6px; } }
.gio { display: inline-block; margin: 0 6px 4px 0; padding: 2px 8px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-weight: 600; } .gio small { font-weight: 400; color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; } .cal-h { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-c { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; min-height: 52px; color: var(--ink); }
.cal-c b { font-size: 16px; } .cal-c small { font-size: 11px; color: var(--muted); } .cal-c.empty { border: 0; background: none; cursor: default; }
.cal-c.ram { border-color: var(--gold); } .cal-c.today-c { background: var(--lac); color: #fff; } .cal-c.today-c small { color: #ffe; } .cal-c.sel { outline: 2px solid var(--gold); }
i.hd, i.ky { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); vertical-align: middle; } i.ky { background: var(--err); }
.cal-c i.hd { position: absolute; top: 4px; left: 5px; } .cal-c i.ky { position: absolute; top: 4px; right: 5px; }
.good-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin: 8px 0; }
.gd { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; color: var(--ink); } .gd small { color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; } .tab { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 700; cursor: pointer; color: var(--ink); } .tab.on { background: var(--lac); color: #fff; border-color: var(--lac); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; } .nchip { border: 1px solid var(--line); border-radius: 16px; padding: 4px 12px; background: var(--panel); cursor: pointer; color: var(--ink); } .nchip.on { background: var(--gold-soft); border-color: var(--gold); font-weight: 700; }
.news { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; } .news:hover .news-t { color: var(--lac); } .news-t { font-weight: 700; }

/* vinh danh có xét duyệt */
.steps { margin: 8px 0 12px; padding-left: 20px; } .steps li { margin: 3px 0; }
.honor-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-bottom: 14px; }
.honor-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.honor-card.pend { border-style: dashed; border-color: var(--gold); }
.honor-ph { width: 84px; height: 104px; object-fit: cover; border-radius: 10px; border: 2px solid var(--gold); flex: none; background: var(--gold-soft); display: flex; align-items: center; justify-content: center; color: var(--gold); }
.honor-ph.big { width: 160px; height: 200px; } .honor-ph .ic { width: 36px; height: 36px; }
.honor-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; } .honor-n { font-family: var(--serif); font-size: 18px; color: var(--lac); }
.honor-act { margin-top: 6px; gap: 6px; } .req { color: var(--err); }
.doc-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; margin-right: 4px; border: 1px solid var(--line); }
.doc-img { width: 100%; border-radius: 8px; margin: 6px 0; border: 1px solid var(--line); }
.flash-card { animation: flashIn 2.4s; outline: 2px solid var(--gold); }

/* bàn thờ trang nghiêm ở trang chủ */
.hero-shrine { flex: none; width: 300px; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; z-index: 1; }
.shrine { position: relative; width: 270px; height: 250px; cursor: pointer; }
.sh-halo { position: absolute; left: 50%; top: 46%; width: 230px; height: 230px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 90, .28), rgba(255, 150, 60, .08) 45%, transparent 70%); animation: halo 6s ease-in-out infinite; }
.shrine:not(.lit) .sh-halo { opacity: .35; }
@keyframes halo { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: .8; } }
.sh-tablet { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); width: 156px; padding: 10px 8px 10px; text-align: center; border-radius: 40px 40px 6px 6px; background: linear-gradient(#8f2a1c, #5c1711); border: 2px solid #d9ae5c; box-shadow: 0 0 0 4px rgba(217, 174, 92, .18), 0 6px 18px rgba(0, 0, 0, .45); color: #ffe9bd; }
.sh-tablet small { display: block; font-size: 10px; letter-spacing: .08em; color: #d9ae5c; text-transform: uppercase; } .sh-tablet b { display: block; font: 700 17px/1.25 var(--display); white-space: nowrap; }
.sh-candle { position: absolute; bottom: 30px; width: 16px; height: 74px; border-radius: 3px; background: linear-gradient(90deg, #a31d14, #e2412f 45%, #8a150e); box-shadow: inset 0 -6px 0 #d9ae5c; }
.sh-candle.l { left: 22px; } .sh-candle.r { right: 22px; }
.sh-candle::before { content: ""; position: absolute; bottom: -8px; left: -6px; width: 28px; height: 8px; border-radius: 3px; background: linear-gradient(#e6c06a, #8a5f1a); }
.sh-candle .flame { position: absolute; left: 50%; top: -24px; width: 12px; height: 22px; margin-left: -6px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%; background: radial-gradient(ellipse at 50% 75%, #fff7d0 0%, #ffd56b 35%, #ff8a2b 70%, rgba(255, 90, 30, 0) 100%); box-shadow: 0 0 18px 6px rgba(255, 170, 60, .55); transform-origin: 50% 100%; animation: flick 1.6s ease-in-out infinite alternate; }
.sh-candle.r .flame { animation-duration: 1.9s; animation-delay: .4s; }
@keyframes flick { 0% { transform: scale(1, 1) rotate(-2deg); opacity: .95; } 30% { transform: scale(.92, 1.08) rotate(2deg); } 60% { transform: scale(1.05, .94) rotate(-1deg); opacity: 1; } 100% { transform: scale(.96, 1.04) rotate(1.5deg); opacity: .9; } }
.sh-burner { position: absolute; bottom: 26px; left: 50%; width: 112px; height: 52px; margin-left: -56px; border-radius: 10px 10px 50px 50px; background: linear-gradient(#f0cf7a, #b8892f 45%, #6e4a12); box-shadow: inset 0 6px 0 rgba(255, 240, 200, .35), 0 8px 18px rgba(0, 0, 0, .5); }
.sh-burner .ear { position: absolute; top: 6px; width: 14px; height: 22px; border: 4px solid #b8892f; border-radius: 10px; } .sh-burner .ear.l { left: -14px; } .sh-burner .ear.r { right: -14px; }
.sh-burner .ft { position: absolute; bottom: -12px; width: 12px; height: 14px; background: #6e4a12; border-radius: 0 0 6px 6px; } .sh-burner .ft.l { left: 22px; } .sh-burner .ft.r { right: 22px; }
.sh-sticks { position: absolute; bottom: 72px; left: 50%; width: 40px; height: 62px; margin-left: -20px; }
.sh-sticks i { position: absolute; bottom: 0; left: 19px; width: 2px; height: 60px; background: linear-gradient(#5a1a12, #c0392b 20%, #a0522d); transform-origin: bottom; }
.sh-sticks i:nth-child(1) { transform: rotate(-9deg); } .sh-sticks i:nth-child(3) { transform: rotate(9deg); }
.shrine.lit .sh-sticks i::after { content: ""; position: absolute; top: -3px; left: -1.5px; width: 5px; height: 5px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 10px 3px #ff8a3d; animation: ember 2.2s ease-in-out infinite; }
@keyframes ember { 50% { box-shadow: 0 0 4px 1px #ff8a3d; opacity: .75; } }
.shrine .smoke { bottom: 128px; left: 124px; display: none; } .shrine .smoke.s2 { left: 130px; } .shrine .smoke.s3 { left: 118px; }
.shrine.lit .smoke { display: block; }
.shrine:hover .sh-tablet, .shrine:focus .sh-tablet { box-shadow: 0 0 0 4px rgba(217, 174, 92, .35), 0 0 28px 6px rgba(255, 190, 90, .45); }
.sh-note { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: #f3dfc0; font-size: 14px; }
.sh-note small { color: #d9ae5c; } .sh-sp { color: #ffe9bd; } .sh-remind { color: #ffd9a0; animation: remind 2.8s ease-in-out infinite; }
@keyframes remind { 50% { opacity: .65; } }
.hero .btn.snd, .btn.snd { background: rgba(255, 255, 255, .08); color: inherit; border-color: rgba(217, 174, 92, .5); } .btn.snd.on { background: rgba(217, 174, 92, .25); }
.altar-big { position: relative; } .altar-big .sh-candle { bottom: 22px; height: 64px; } .altar-big .sh-candle.l { left: 18%; } .altar-big .sh-candle.r { right: 18%; }
@media (max-width: 700px) { .hero { flex-direction: column; align-items: stretch; } .hero-shrine { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .sh-candle .flame, .sh-halo, .sh-remind, .shrine .sh-sticks i::after { animation: none; } }

.seg { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 6px 0 10px; } .seg-b { border: 1px solid var(--gold); background: var(--panel); color: var(--ink); border-radius: 18px; padding: 6px 12px; font-weight: 700; cursor: pointer; } .seg-b.on { background: var(--lac); color: #fff; border-color: var(--lac); }
.tram-in.wide { width: 120px; }

/* bảng rộng trên điện thoại: cuộn ngang trong thẻ, không làm cả trang trượt ngang */
.card { overflow-x: auto; } .card .tbl { min-width: 100%; }

/* thông gia, đường về cổng */
.hub-back { width: 100%; justify-content: flex-start; margin-bottom: 4px; }
.tg-item { border-top: 1px dashed var(--line); padding: 8px 0; } .tg-item:first-of-type { border-top: 0; }
.tg-msgs { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; margin: 6px 0 10px; }
.tg-msg { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; max-width: 85%; } .tg-msg p { margin: 2px 0 0; }
.tg-msg.me { align-self: flex-end; background: var(--gold-soft); border-color: var(--gold); }

/* Gia Phả Việt · trang cổng · Bản quyền © 2026 ThienNV */
body.hub { background: var(--paper); color: var(--ink); margin: 0; }
.hub-top { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.hub-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.hub-brand img { width: 40px; height: 40px; border-radius: 10px; }
.hub-brand b { display: block; font: 700 20px/1.1 var(--display); color: var(--lac); } .hub-brand small { color: var(--muted); }
.hub-main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 30px; }
.hub-hero { margin-bottom: 16px; } .hub-hero .hero-t { font-size: 46px; }
.hub-me .hub-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; } .hub-me .hub-go .btn { font-size: 16px; padding: 10px 16px; }
.hub-day { display: flex; gap: 14px; align-items: center; } .hub-day > b { font: 700 54px/1 var(--display); color: var(--lac); }
.hub-feat { margin: 0; padding-left: 4px; list-style: none; } .hub-feat li { margin: 6px 0; }
.hub-clans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hub-clan { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; }
.hub-clan b { font: 700 18px/1.2 var(--display); color: var(--lac); } .hub-clan .tag { align-self: flex-start; } .hub-clan:hover { border-color: var(--gold); box-shadow: var(--shadow); }
@media (max-width: 700px) { .hub-hero .hero-t { font-size: 34px; } .hub-top { padding: 8px 12px; } }
