/* Gia phả số — giao diện dạng ứng dụng, ưu tiên người cao tuổi */
:root {
  --scale: 1;
  --brand: #A8470D;
  --brand-dark: #7A3006;
  --brand-soft: #F6E7D6;
  --gold: #B8860B;
  --bg: #FBF6EC;
  --surface: #FFFFFF;
  --surface-2: #FFF9F0;
  --text: #2B1A0E;
  --text-2: #5C4330;
  --line: #E3D2B6;
  --line-strong: #C9AE86;
  --ok: #1E6B35;
  --ok-soft: #E6F4EA;
  --warn: #8A5A00;
  --warn-soft: #FFF3D1;
  --danger: #A61B1B;
  --danger-soft: #FDECEC;
  --radius: 14px;
  --tap: 3.1rem;            /* chiều cao nút tối thiểu (~56px) */
  --nav-w: 0px;
  --panel-w: 400px;
  --top-h: 4rem;
  --shadow: 0 2px 10px rgba(80, 40, 10, .10);
  color-scheme: light;
}
/* 2.0.121: chờ áp tông màu đã chọn để không nháy màu đỏ */
html.th-wait body { visibility: hidden; }
html.contrast {
  --brand: #6B2400; --brand-dark: #3D1400; --brand-soft: #FFE7CC;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF;
  --text: #000000; --text-2: #1A1A1A; --line: #555; --line-strong: #000;
}
html { font-size: calc(18px * var(--scale)); -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5; overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-dark); }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 2px; }
html.tv :focus { outline: 6px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Khung app ---------- */
.shell {
  height: 100vh; height: 100dvh; display: grid;
  grid-template-columns: var(--nav-w) 1fr 0px;
  grid-template-rows: var(--top-h) 1fr auto;
  grid-template-areas: "top top top" "nav main panel" "bnav bnav bnav";
  overflow: hidden;
}
.shell.panel-open { grid-template-columns: var(--nav-w) 1fr var(--panel-w); }
.topbar {
  grid-area: top; display: flex; align-items: center; gap: .6rem; padding: 0 .8rem;
  padding-top: env(safe-area-inset-top); background: var(--brand); color: #fff; z-index: 5;
  min-width: 0;
}
.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1; background: none; border: 0; color: #fff; padding: 0; text-align: left; }
.brand img { width: 2.3rem; height: 2.3rem; border-radius: 10px; background: #fff; flex: none; }
.brand b { font-size: 1.05rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.brand small { opacity: .85; font-size: .8rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search {
  display: flex; align-items: center; gap: .5rem; background: #fff; color: var(--text-2);
  border: 0; border-radius: 999px; height: 2.7rem; padding: 0 1rem; min-width: 0;
}
.top-search span { white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-width: var(--tap); height: var(--tap); padding: 0 .7rem; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 0; color: #fff; font-weight: 600;
}
.ic { width: 1.4em; height: 1.4em; flex: none; display: inline-block; vertical-align: middle; }

.nav { grid-area: nav; background: var(--surface); border-right: 1px solid var(--line); display: none; }
.bnav {
  grid-area: bnav; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  min-height: 4rem; padding: .3rem .2rem; background: none; border: 0; color: var(--text-2);
  font-size: .78rem; font-weight: 600; text-decoration: none; position: relative;
}
.nav-item .ic { width: 1.7rem; height: 1.7rem; }
.nav-item.active { color: var(--brand); }
.nav-item.active::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 4px; border-radius: 0 0 4px 4px; background: var(--brand); }
.badge { position: absolute; top: .3rem; right: 22%; min-width: 1.3rem; height: 1.3rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; display: grid; place-items: center; padding: 0 .3rem; }

.main { grid-area: main; overflow: auto; min-width: 0; position: relative; -webkit-overflow-scrolling: touch; }
.view { padding: 1rem; max-width: 1100px; margin: 0 auto; animation: fade .18s ease-out; }
.view.full { max-width: none; padding: 0; height: 100%; display: flex; flex-direction: column; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Hồ sơ: khung phải (tablet/desktop) hoặc tấm trượt (điện thoại) */
.panel { grid-area: panel; background: var(--surface); border-left: 1px solid var(--line); overflow: auto; min-width: 0; }
.panel-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .8rem; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 2; }
.panel-head .grab { display: none; }
.panel-body { padding: 1rem; }
.backdrop { display: none; }

@media (max-width: 599px) {
  .tree-bar { padding: .4rem .5rem; gap: .35rem; }
  .tree-bar .t { display: none; }
  .tree-bar .btn.sm { padding: .2rem .55rem; }
  .seg button { padding: 0 .6rem; font-size: .92rem; min-height: 2.5rem; }
  .fcenter { padding: .8rem; gap: .7rem; align-items: flex-start; }
  .fcenter .avatar.lg { width: 4rem; height: 4rem; font-size: 1.3rem; }
  .fcenter h2 { font-size: 1.25rem; }
  .top-search span { display: none; }
  .top-search { width: var(--tap); justify-content: center; padding: 0; background: rgba(255,255,255,.16); color: #fff; }
  .shell, .shell.panel-open { grid-template-columns: 0 1fr 0; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; height: 88dvh; max-height: 88vh; border-radius: 22px 22px 0 0;
    border: 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25); transform: translateY(105%); transition: transform .25s ease; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .shell.panel-open .panel { transform: none; }
  .panel-head .grab { display: block; position: absolute; top: 6px; left: 50%; width: 3rem; height: 5px; margin-left: -1.5rem; border-radius: 9px; background: var(--line-strong); }
  .panel-head { padding-top: 1rem; }
  .shell.panel-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
}
@media (min-width: 600px) {
  :root { --nav-w: 6.2rem; }
  .bnav { display: none; }
  .shell { grid-template-rows: var(--top-h) 1fr; grid-template-areas: "top top top" "nav main panel"; }
  .nav { display: flex; flex-direction: column; gap: .2rem; padding: .5rem .3rem; }
  .nav-item { border-radius: 14px; min-height: 4.6rem; }
  .nav-item.active { background: var(--brand-soft); }
  .nav-item.active::before { display: none; }
  .badge { right: 18%; }
  .shell.panel-open { --panel-w: min(400px, 45vw); }
}
@media (min-width: 1100px) {
  :root { --nav-w: var(--nav-w-user, 17.5rem); }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: .8rem; padding: 0 1rem; font-size: 1rem; min-height: var(--tap); }
  .badge { position: static; margin-left: auto; }
  .shell.panel-open { --panel-w: 440px; }
}
html.tv .shell { --nav-w: var(--nav-w-user, 16rem); }
html.tv .bnav { display: none; }

/* ---------- Thành phần chung ---------- */
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.08rem; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem; box-shadow: var(--shadow); }
.card.soft { background: var(--surface-2); box-shadow: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: var(--tap); padding: .4rem 1.1rem; border-radius: 12px; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; text-align: center;
}
.btn.ghost { background: var(--surface); color: var(--brand-dark); }
.btn.plain { background: transparent; border-color: transparent; color: var(--brand-dark); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 2.5rem; padding: .2rem .8rem; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .85rem; font-weight: 600; border: 0; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.gray { background: #EEE8DF; color: #4A3B2D; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.seg { display: inline-flex; background: var(--brand-soft); border-radius: 14px; padding: .25rem; gap: .25rem; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 10px; min-height: 2.6rem; padding: 0 .9rem; font-weight: 700; color: var(--brand-dark); }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--brand); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--text-2); }
.warnbox { background: var(--warn-soft); border: 1px solid #E9CF83; border-radius: 12px; padding: .8rem; color: #5A3B00; }
.okbox { background: var(--ok-soft); border-radius: 12px; padding: .8rem; color: var(--ok); }
.errbox { background: var(--danger-soft); border-radius: 12px; padding: .8rem; color: var(--danger); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.li-btn { width: 100%; display: flex; align-items: center; gap: .8rem; text-align: left; background: none; border: 0; padding: .75rem .3rem; min-height: var(--tap); }
.li-btn:hover { background: var(--surface-2); }
.avatar { width: 3rem; height: 3rem; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--brand-soft); color: var(--brand-dark); object-fit: cover; overflow: hidden; }
.avatar.lg { width: 6rem; height: 6rem; font-size: 1.8rem; }
.avatar.dead { filter: grayscale(.6); }
.skel { background: linear-gradient(90deg, #EFE5D6 25%, #F8F0E4 50%, #EFE5D6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 1.2rem; margin: .6rem 0; }
@keyframes sk { to { background-position: -200% 0; } }

/* Biểu mẫu */
.field { margin-bottom: .9rem; }
.field label, .lbl { display: block; font-weight: 700; margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: .5rem .8rem; border: 2px solid var(--line-strong);
  border-radius: 12px; background: #fff; font-size: 1rem;
}
.field textarea { min-height: 6rem; }
.field .hint { font-size: .85rem; color: var(--text-2); margin-top: .25rem; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* Hộp thoại (in-app) */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal-head { position: sticky; top: 0; background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid var(--line); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 1rem; }
.modal-foot { position: sticky; bottom: 0; background: var(--surface); display: flex; gap: .6rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.modal-foot .btn { flex: 1; }
@media (max-width: 599px) { .modal-wrap { padding: 0; align-items: flex-end; } .modal { border-radius: 20px 20px 0 0; max-height: 94dvh; } }
.close-btn { background: var(--brand-soft); color: var(--brand-dark); border: 0; border-radius: 999px; min-width: var(--tap); height: var(--tap); font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; padding: 0 .9rem; }

.toast { position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #2B1A0E; color: #fff; padding: .8rem 1.1rem; border-radius: 14px; z-index: 60; display: flex; gap: 1rem; align-items: center; max-width: 92vw; box-shadow: var(--shadow); }
.toast button { background: none; border: 0; color: #FFD27A; font-weight: 800; }
@media (min-width: 600px) { .toast { bottom: 1.5rem; } }

/* ---------- Cây gia phả ---------- */
.tree-bar { position: sticky; top: 0; z-index: 3; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .6rem .8rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.tree-bar .spacer { flex: 1; }
.tree-scroll { flex: 1; overflow: auto; padding: .8rem .6rem 3rem; }
.tree { --tz: 1; font-size: calc(1rem * var(--tz)); width: max-content; min-width: 100%; }
.tree .pcard { max-width: none; }
.tree .pcard .nm { overflow: visible; }
.tnode { position: relative; }
.tkids { margin-left: 1.35em; padding-left: .9em; border-left: 3px solid var(--line-strong); }
.tkids > .tnode::before { content: ""; position: absolute; left: -.9em; top: 1.55em; width: .85em; border-top: 3px solid var(--line-strong); }
.tkids > .tnode:last-child::after { content: ""; position: absolute; left: calc(-.9em - 3px); top: 1.62em; bottom: 0; width: 3px; background: var(--bg); }
.trow { display: flex; align-items: center; gap: .35em; padding: .2em 0; }
.tog { width: 2.4em; height: 2.4em; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 900; color: var(--brand-dark); display: grid; place-items: center; padding: 0; font-size: .95em; }
.tog.leaf { visibility: hidden; }
.pcard {
  display: inline-flex; align-items: center; gap: .55em; min-height: 2.9em; padding: .25em .9em .25em .35em;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px; text-align: left; max-width: 100%;
  box-shadow: var(--shadow);
}
.pcard .avatar { width: 2.3em; height: 2.3em; font-size: .85em; }
.pcard .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .sub { font-size: .78em; color: var(--text-2); white-space: nowrap; }
.pcard.male { border-color: #D8B89A; }
.pcard.female { border-color: #E4B4C2; }
.pcard.out { border-style: dashed; }
.pcard.dead .nm { color: #4B3A2C; }
.pcard.sel { border-color: var(--brand); background: var(--brand-soft); outline: 3px solid var(--brand); }
.pcard.hit { animation: hit 1.6s ease 2; }
@keyframes hit { 50% { box-shadow: 0 0 0 8px rgba(184,134,11,.45); } }
.code { font-size: .75em; font-weight: 800; color: #9C7A55; min-width: 2em; }
.flag-dot { width: .65em; height: .65em; border-radius: 50%; background: #E0A100; flex: none; }
.spouses { font-size: .82em; color: var(--text-2); margin-left: .4em; }

/* Tiêu điểm */
.focus { padding: 1rem; max-width: 900px; margin: 0 auto; }
.fsec { margin: .4rem 0 1rem; }
.fsec h3 { font-size: .95rem; color: var(--text-2); text-transform: none; margin-bottom: .4rem; }
.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .6rem; }
.fcard { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; min-height: 4.2rem; box-shadow: var(--shadow); }
.fcard b { display: block; }
.fcard small { color: var(--text-2); }
.fcenter { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 22px; border: 3px solid var(--brand); background: var(--brand-soft); margin: .6rem 0 1rem; }
.fcenter h2 { margin: 0; font-size: 1.45rem; }
.arrow-down { text-align: center; color: var(--line-strong); font-size: 1.4rem; line-height: 1; }

/* Theo đời */
.gen h2 { position: sticky; top: 0; background: var(--bg); padding: .5rem 0; margin: 0; z-index: 1; }

/* Hồ sơ */
.prof-top { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.prof-top h2 { margin: 0 0 .2rem; font-size: 1.4rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 600; }
.rel-group { margin-bottom: .7rem; }
.rel-group .lbl { color: var(--text-2); font-weight: 600; font-size: .9rem; }
.rel-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.rel-chip { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 2.7rem; padding: 0 .9rem; font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: .5rem; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.note { padding: .6rem .8rem; background: var(--surface-2); border-radius: 12px; margin-bottom: .5rem; white-space: pre-wrap; }
.actions-sticky { position: sticky; bottom: 0; background: var(--surface); padding: .7rem 0; display: flex; gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.actions-sticky .btn { flex: 1 1 10rem; }
.rel-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.rel-choice button { min-height: 5.2rem; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 800; font-size: 1.05rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; }
.rel-choice button small { font-weight: 500; color: var(--text-2); }

/* Tìm kiếm */
.search-box { display: flex; gap: .5rem; align-items: center; }
.search-box input { flex: 1; min-height: 3.4rem; font-size: 1.15rem; border: 2px solid var(--brand); border-radius: 14px; padding: 0 1rem; min-width: 0; }
.mic { min-width: 3.4rem; height: 3.4rem; border-radius: 14px; border: 0; background: var(--brand); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: 0 .8rem; }
.mic.listening { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(166,27,27,.25); } }
.heard { margin: .6rem 0; font-size: 1.05rem; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.filters select { min-height: 2.8rem; border-radius: 10px; border: 2px solid var(--line-strong); padding: 0 .6rem; background: #fff; }

/* Lịch giỗ */
.today { display: flex; gap: 1rem; align-items: center; background: var(--brand); color: #fff; border-radius: 18px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.today .big { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.ev { display: flex; gap: .9rem; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .7rem .9rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.ev .date { flex: none; width: 4.4rem; text-align: center; border-radius: 12px; background: var(--brand-soft); padding: .35rem 0; }
.ev .date b { display: block; font-size: 1.5rem; line-height: 1.1; color: var(--brand-dark); }
.ev .date small { font-size: .78rem; }
.ev.soon { border: 2px solid var(--brand); }
.month-h { margin: 1.1rem 0 .5rem; color: var(--text-2); font-size: 1rem; }

/* Mộ phần */
#map { height: 52vh; min-height: 280px; border-radius: 16px; border: 1px solid var(--line); margin-bottom: 1rem; background: #EEE6D8; }

/* TV: trình chiếu */
.slideshow { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; height: 100%; padding: 2rem; }
.slideshow .avatar { width: 10rem; height: 10rem; font-size: 3rem; }
.slideshow h1 { font-size: 2.6rem; margin: 1rem 0 .3rem; }

@media print { .topbar, .nav, .bnav, .tree-bar, .panel { display: none !important; } .shell { display: block; height: auto; } .main { overflow: visible; } }

/* ===== Module: Trang chủ, Ký sự, Giỗ chạp, Địa danh, Góp ý ===== */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sec-h { font-size: 1.2rem; margin: .6rem 0; color: var(--brand-dark); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: .7rem; margin-top: 1rem; }
.tile { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow); min-height: 7rem; }
.tile .ic { width: 2.2rem; height: 2.2rem; color: var(--brand); }
.tile b { font-size: 1.08rem; } .tile small { color: var(--text-2); }
.tile:hover { border-color: var(--brand); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .8rem; }
.ncard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.ncard img, .ncard-ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.ncard-ph .ic { width: 3rem; height: 3rem; }
.ncard-in { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.ncard-in b { font-size: 1.08rem; line-height: 1.3; }
.article h1 { font-size: 1.6rem; margin: .4rem 0; }
.lead { font-size: 1.12rem; font-weight: 600; color: var(--text-2); }
.prose p { margin: 0 0 .9rem; font-size: 1.05rem; line-height: 1.75; }

/* Slide */
.slider { position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 1rem; background: #2B1A0E; box-shadow: var(--shadow); }
.sl-track { display: flex; transition: transform .45s ease; }
.sl-item { flex: 0 0 100%; min-width: 0; }
.sl-item > img { width: 100%; aspect-ratio: var(--ratio, 16/9); object-fit: cover; display: block; }
.slider[style*="auto"] .sl-item > img { aspect-ratio: 16/9; }
.sl-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); color: var(--brand-dark); font-size: 2rem; line-height: 1; font-weight: 700; display: grid; place-items: center; box-shadow: var(--shadow); }
.sl-nav.prev { left: .6rem; } .sl-nav.next { right: .6rem; }
.sl-dots { position: absolute; bottom: .6rem; left: 0; right: 0; display: flex; justify-content: center; gap: .4rem; }
.sl-dots button { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid #fff; background: rgba(255,255,255,.35); padding: 0; }
.sl-dots button.on { background: #fff; }
.sl-item > .hero-slide { height: 100%; }
.hero-slide { position: relative; display: block; min-height: 20rem; color: #fff; text-decoration: none; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.hero-bg.plain { background: linear-gradient(135deg, #7A3006, #A8470D); opacity: 1; }
.hero-in { position: relative; padding: 1.6rem 4.2rem 2.6rem; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.hero-in h2 { font-size: 1.7rem; margin: .2rem 0; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hero-when { font-size: 1.05rem; font-weight: 600; }
.hero-slide .btn { background: #fff; color: var(--brand-dark); border-color: #fff; }
@media (max-width: 599px) { .hero-in { padding: 1.2rem 1rem 2.6rem; } .hero-in h2 { font-size: 1.35rem; } .sl-nav { width: 2.6rem; height: 2.6rem; font-size: 1.6rem; } .slider.hero .sl-nav { display: none; } }
.next-ev { display: block; text-decoration: none; color: inherit; border: 2px solid var(--brand); }

/* Đếm ngược */
.cd { display: flex; gap: .5rem; margin-top: .4rem; }
.cd-u { min-width: 3.6rem; text-align: center; background: rgba(0,0,0,.25); color: #fff; border-radius: 12px; padding: .35rem .4rem; }
.card .cd-u, .next-ev .cd-u { background: var(--brand); }
.cd-u b { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-u small { font-size: .75rem; opacity: .9; }
.cd.big .cd-u { min-width: 4.6rem; padding: .6rem .5rem; } .cd.big .cd-u b { font-size: 2.2rem; }
.cd-now { font-size: 1.6rem; font-weight: 900; color: var(--danger); }
.when-box { display: flex; gap: 1.5rem; flex-wrap: wrap; background: var(--surface-2); border-radius: 14px; padding: .8rem 1rem; }
.when-box b { font-size: 1.1rem; }
a.ev { text-decoration: none; color: inherit; }

/* Ảnh: chọn, xem trước */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.pick-it { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.pick-it img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pick-act { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; }
.pick-act .btn.sm { min-height: 2rem; padding: 0 .5rem; font-size: .8rem; }

/* Bài của khách (thăm viếng, góp ý) */
.sub { padding: .8rem 0; border-top: 1px solid var(--line); transition: opacity .3s; }
.sub-head { display: flex; gap: .6rem; align-items: center; }
.sub.faded { opacity: .45; }
.sub.faded:hover { opacity: .8; }
.pending-note { display: inline-block; margin-top: .4rem; padding: .15rem .6rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .85rem; }
.reply { margin-top: .5rem; padding: .6rem .8rem; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.card > .sub:first-child { border-top: 0; padding-top: 0; }

/* Nhánh */
.branch h2 { font-size: 1.25rem; }
.sub-branches { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--line-strong); }
.cd.big { max-width: 26rem; }
.cd.big .cd-u { flex: 1; min-width: 0; }
@media (max-width: 599px) { .cd.big .cd-u b { font-size: 1.8rem; } .cd-u { min-width: 3.2rem; } }

/* ---------- Phả đồ (bản vẽ) ---------- */
.tree-scroll.pado-host { padding: 0; overflow: hidden; position: relative; }
.pado { position: absolute; inset: 0; overflow: hidden; background: #f6efe1; touch-action: none; cursor: grab; outline: none; }
.pado.dragging { cursor: grabbing; }
.pado:focus-visible { box-shadow: inset 0 0 0 3px var(--brand); }
.pado > svg { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; box-shadow: 0 4px 24px rgba(80,40,10,.18); user-select: none; }
.pado .pn { cursor: pointer; }
.pado .pn:hover rect { filter: brightness(1.15); }
.pado-hint { position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); background: rgba(255,255,255,.92); border-radius: 999px;
  padding: .3rem .9rem; font-size: .85rem; color: var(--muted); box-shadow: var(--shadow); pointer-events: none; white-space: nowrap; max-width: 94%; overflow: hidden; text-overflow: ellipsis; }
.sel-sm { min-height: 2.5rem; border-radius: 10px; border: 2px solid var(--line-strong); padding: 0 .5rem; background: #fff; font-weight: 600; max-width: 12rem; }
@media (max-width: 599px) { .pado-hint { font-size: .75rem; } .sel-sm { max-width: 9.5rem; font-size: .9rem; } }
.pado-hint { transition: opacity .6s; }
.pado-hint.gone { opacity: 0; }
.pado-ctl { position: absolute; right: .8rem; bottom: 3.2rem; display: flex; flex-direction: column; gap: .5rem; z-index: 2; }
.pado-ctl .btn { width: 3.2rem; height: 3.2rem; min-height: 0; padding: 0; justify-content: center; font-size: 1.6rem; line-height: 1; border-radius: 50%; box-shadow: var(--shadow); }
@media (max-width: 599px) {
  .tree-bar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tree-bar .seg button { white-space: nowrap; flex: none; }
}

/* ---------- Toàn màn hình khi xem cây (dọc / ngang) ---------- */
html.tree-fs .topbar, html.tree-fs .nav, html.tree-fs .bnav { display: none !important; }
html.tree-fs .shell { --nav-w: 0px; --top-h: 0px; grid-template-rows: 0 1fr 0; }
html.tree-fs .main { background: var(--bg); }
.fs-float { position: fixed; bottom: max(.8rem, env(safe-area-inset-bottom)); left: .8rem; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem; max-width: calc(100vw - 6rem); }
.fs-exit, .fs-tools {
  display: inline-flex; align-items: center; gap: .45rem; max-width: 92vw; min-height: 2.8rem; padding: 0 1.1rem; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: .92; }
.fs-exit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.tree-fs .pado-hint { bottom: auto; top: .6rem; }
html.tree-fs.tv .fs-exit { font-size: 1.2rem; }
html.tree-fs .tree-scroll:not(.pado-host) { padding-bottom: 6rem; }

/* Bộ lọc địa danh: loại + tỉnh thành */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.tinh-pick { display: inline-flex; align-items: center; gap: .4rem; background: var(--brand-soft); border-radius: 14px; padding: .25rem .25rem .25rem .7rem; color: var(--brand-dark); }
.sel-tinh { min-height: 2.6rem; border: 0; border-radius: 10px; padding: 0 .6rem; background: var(--surface); font-weight: 700; color: var(--brand); max-width: min(26rem, 78vw); box-shadow: var(--shadow); }
.chips-row { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.2rem 0 .9rem; }
.rel-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 599px) { .filter-bar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; } .filter-bar .seg button { white-space: nowrap; flex: none; } .tinh-pick { width: 100%; box-sizing: border-box; } .sel-tinh { flex: 1; min-width: 0; width: 100%; max-width: none; } }

/* Ảnh địa danh: hiện trọn khung, bấm để xem lớn */
div.ncard .ncard-in { text-decoration: none; color: var(--text); flex: 1; }
.ncard-pic { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #efe3d1; cursor: zoom-in; }
.ncard .ncard-pic img { width: 100%; aspect-ratio: 16/9; object-fit: contain; display: block; background: transparent; }
.ncard-zoom { position: absolute; right: .5rem; bottom: .5rem; background: rgba(43,26,14,.72); color: #fff; font-size: .82rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
a.ncard-ph { text-decoration: none; }
.sl-item > img.zoomable { object-fit: contain; cursor: zoom-in; }
.gal-btn { padding: 0; border: 0; background: none; cursor: zoom-in; }
.gal-btn img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(15,9,4,.94); display: flex; align-items: center; justify-content: center; }
html.lb-open { overflow: hidden; }
.lb-img { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem; }
.lb-img img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-img.zoomed { display: block; padding: 0; }
.lb-img.zoomed img { max-width: none; max-height: none; width: 200%; cursor: zoom-out; border-radius: 0; }
@media (min-width: 900px) { .lb-img.zoomed img { width: auto; min-width: 100%; } }
.lb-close { position: absolute; top: max(.7rem, env(safe-area-inset-top)); right: .7rem; z-index: 2; width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #2b1a0e; font-size: 1.6rem; font-weight: 800; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #2b1a0e; font-size: 2.2rem; line-height: 1; }
.lb-nav.prev { left: .7rem; } .lb-nav.next { right: .7rem; }
.lb-count { position: absolute; bottom: max(.8rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; z-index: 2; text-shadow: 0 1px 3px #000; }
.gmap-msg:empty { display: none; }
.gmap-msg { margin-top: .4rem; padding: .5rem .7rem; }
.sl-item > img.zoomable { max-height: min(62vh, 460px); }

/* Lễ/giỗ: tỉnh · Google Maps · người trị sự */
div.ev { cursor: pointer; }
div.ev:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ev-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .35rem 0 .3rem; font-size: .92rem; color: var(--brand-dark); }
.ev-meta .meta-i { display: inline-flex; align-items: center; gap: .3rem; }
.ev-meta .ic { width: 1.05rem; height: 1.05rem; }
.ev-meta a.link, .ev-meta a.tel { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ev-meta a.tel { margin-left: .35rem; white-space: nowrap; }
.ev-meta.big { font-size: 1.02rem; margin-top: .8rem; }
@media (max-width: 599px) {
  .ev { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: .8rem; row-gap: .35rem; }
  .ev > .chip { grid-column: 2; justify-self: start; }
  .ev .date { width: 3.8rem; }
}
.ev-meta .meta-i { flex-wrap: wrap; }

/* Bộ lọc địa danh 2 hàng (tỉnh thành / loại) — nút to cho người lớn tuổi */
.filters2 { padding: .8rem 1rem; display: grid; gap: .8rem; }
.f-row { display: grid; gap: .4rem; }
.f-lbl { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; color: var(--brand-dark); font-size: .98rem; }
.f-lbl .ic { width: 1.15rem; height: 1.15rem; }
.fchips { display: flex; flex-wrap: wrap; gap: .5rem; }
.fchip { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.9rem; padding: 0 1.05rem; border-radius: 999px; border: 2px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 1.02rem; cursor: pointer; }
.fchip .n { min-width: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .85rem; text-align: center; }
.fchip:hover { border-color: var(--brand); }
.fchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fchip.on .n { background: rgba(255,255,255,.25); color: #fff; }
@media (max-width: 599px) { .filters2 { padding: .7rem .7rem; } .fchip { min-height: 2.7rem; padding: 0 .85rem; font-size: .98rem; } }

/* Chọn cây gia phả */
.tree-pick { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem .8rem; background: var(--brand-soft); border-bottom: 1px solid var(--line); color: var(--brand-dark); }
.tree-pick > .ic { width: 1.5rem; height: 1.5rem; flex: none; }
.tree-pick .spacer { flex: 1; }
.tp-lbl { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .8; }
.tp-name b { font-size: 1.12rem; }
.tp-sel { display: flex; flex-direction: column; min-width: 0; flex: 0 1 30rem; }
.tp-sel select { min-height: 2.6rem; border-radius: 10px; border: 2px solid var(--line-strong); background: #fff; font-weight: 800; font-size: 1.02rem; color: var(--brand-dark); padding: 0 .6rem; max-width: 100%; }
.choices { display: grid; gap: .5rem; margin-bottom: .9rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .9rem; border: 2px solid var(--line-strong); border-radius: 14px; cursor: pointer; }
.choice input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 599px) { .tree-pick { padding: .45rem .6rem; gap: .45rem; } .tree-pick .t { display: none; } .tp-sel { flex: 1 1 12rem; } }
html.tree-fs .tree-pick { padding: .3rem .6rem; gap: .4rem; } /* 1.2.5: toàn màn hình vẫn có chọn cây, tìm người, Sửa / Tạo cây */
html.tree-fs .tree-pick .tp-lbl { display: none; }

/* Menu con: các cây gia phả (thanh bên máy tính) */
.nav-sub { display: none; }
@media (min-width: 1100px) {
  .nav-sub { display: flex; flex-direction: column; gap: .1rem; margin: -.2rem 0 .4rem 1.4rem; padding-left: .6rem; border-left: 2px solid var(--line-strong); }
  .nav-sub-item { display: flex; align-items: center; gap: .45rem; min-height: 2.4rem; padding: .25rem .55rem; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .95rem; }
  .nav-sub-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-sub-item small { font-size: .75rem; color: var(--muted); }
  .nav-sub-item .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--brand); flex: none; }
  .nav-sub-item.branch .dot { background: transparent; border: 2px solid var(--brand); }
  .nav-sub-item:hover { background: var(--brand-soft); }
  .nav-sub-item.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
  .nav-sub-item.add { color: var(--brand); }
  .nav-sub-item.add .ic { width: 1rem; height: 1rem; }
}

/* Node đã mất, node có liên kết, nút thao tác nhanh */
.pcard.dead { background: #ece6e1; border-color: #8d7b70; }
.pcard.dead .nm { color: #3e312a; }
.fcard.dead { background: #f1ece8; }
.pcard.linked { box-shadow: 0 0 0 2px #1f7a8c inset; }
.link-badge { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #1f7a8c; color: #fff; flex: none; }
.link-badge .ic { width: .9rem; height: .9rem; }
.node-more { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: var(--brand); display: grid; place-items: center; cursor: pointer; }
.node-more:hover { border-color: var(--brand); background: var(--brand-soft); }
.node-more .ic { width: 1.15rem; height: 1.15rem; }
.node-menu { position: fixed; z-index: 150; min-width: 15rem; max-width: 92vw; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 12px 36px rgba(40,20,5,.28); padding: .35rem; display: flex; flex-direction: column; }
.nm-head { padding: .45rem .7rem .35rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.nm-head b { display: block; font-size: 1.05rem; } .nm-head small { color: var(--muted); }
.nm-item { display: flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: 0 .7rem; border: 0; background: none; border-radius: 10px; font-weight: 700; font-size: 1rem; text-align: left; cursor: pointer; color: var(--text); }
.nm-item:hover, .nm-item:focus-visible { background: var(--brand-soft); outline: none; }
.nm-item .ic { width: 1.1rem; height: 1.1rem; color: var(--brand); flex: none; }
.nm-item.link .ic { color: #1f7a8c; }
.nm-sep { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .5rem .7rem .2rem; }
.pd-tip { position: absolute; z-index: 5; max-width: 22rem; background: rgba(33,22,14,.94); color: #fff; padding: .5rem .7rem; border-radius: 10px; font-size: .9rem; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.pd-tip b { font-size: 1rem; } .pd-tip .tip-link { color: #9fe3ef; font-weight: 700; } .pd-tip .tip-hint { opacity: .7; font-size: .8rem; margin-top: .2rem; }
.pado .pd-head.editable { cursor: pointer; }
.pado .pd-head.editable:hover text { fill: #c2570f; }
button.tp-name { border: 0; background: none; text-align: left; color: inherit; cursor: pointer; padding: 0; display: grid; grid-template-columns: auto auto; column-gap: .4rem; align-items: center; }
button.tp-name .tp-lbl { grid-column: 1 / -1; } button.tp-name .ic { width: 1rem; height: 1rem; opacity: .7; }
.link-list { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 14rem; overflow: auto; margin-bottom: .8rem; }
.linkbox { border-color: #1f7a8c; }

/* Tình trạng còn sống / đã mất dạng nút to */
.status-pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.sp-opt { position: relative; }
.sp-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sp-opt span { display: inline-flex; align-items: center; min-height: 2.9rem; padding: 0 1.1rem; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.sp-opt input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.sp-opt.dead input:checked + span { background: #4f4038; border-color: #4f4038; }
.sp-opt input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn.danger-soft { background: #efe9e5; color: #3e312a; border: 2px solid #8d7b70; }
.nm-item.dead-on { color: #4f4038; }

/* Tải về & chia sẻ */
.share-sec { margin-bottom: 1.1rem; }
.share-sec h3 { margin: 0 0 .5rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.share-link { display: flex; gap: .5rem; }
.share-link input { flex: 1; min-width: 0; min-height: 2.9rem; border: 2px solid var(--line-strong); border-radius: 12px; padding: 0 .7rem; font-size: .95rem; background: var(--bg); }
.qr-wrap { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; padding: .8rem; border: 1px dashed var(--line-strong); border-radius: 14px; }
.qr-box img { display: block; width: 200px; height: 200px; image-rendering: pixelated; border-radius: 8px; background: #fff; }
@media (max-width: 599px) { .qr-wrap { flex-direction: column; text-align: center; } .share-link { flex-direction: column; } }

/* Đồng bộ 2 cây */
.sync-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.sync-side { display: flex; flex-direction: column; padding: .6rem .8rem; border: 2px solid #1f7a8c; border-radius: 14px; background: #eef7f9; min-width: 0; }
.sync-side small { color: var(--muted); } .sync-side b { font-size: 1.05rem; } .sync-side span { font-weight: 700; color: #1f7a8c; }
.sync-arrow { font-size: 2rem; color: #1f7a8c; font-weight: 800; }
.sync-tree { margin-top: .8rem; } .sync-tree h2 { font-size: 1.1rem; margin: .4rem 0; }
.sync-group h3 { font-size: .95rem; margin: .7rem 0 .35rem; color: var(--brand-dark); }
.sync-item { display: flex; gap: .65rem; align-items: flex-start; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .35rem; background: var(--surface); }
.sync-item input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; accent-color: var(--brand); flex: none; }
.sync-item span { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.sync-item small { color: var(--text-2); }
.sync-item .chip { align-self: flex-start; }
.sync-group.conflict .sync-item { background: #fff7e6; border-color: #f0c36d; }
@media (max-width: 599px) { .sync-head { grid-template-columns: 1fr; } .sync-arrow { text-align: center; transform: rotate(90deg); } }

/* Ảnh minh họa trên thẻ lễ / giỗ (1.5.1) */
.ev-thumb { position: relative; flex: none; width: 8.5rem; height: 6rem; border-radius: 12px; overflow: hidden; padding: 0; border: 1px solid var(--line); background: var(--brand-soft); cursor: zoom-in; display: flex; align-items: center; justify-content: center; }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ev-thumb:hover img, .ev-thumb:focus-visible img { transform: scale(1.06); }
.ev-thumb:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ev-thumb .cnt { position: absolute; right: .3rem; bottom: .3rem; background: rgba(0,0,0,.62); color: #fff; font-size: .78rem; font-weight: 700; padding: .05rem .4rem; border-radius: 999px; }
.ev-thumb.none { cursor: default; flex-direction: column; gap: .2rem; color: var(--brand-dark); opacity: .55; border-style: dashed; }
.ev-thumb.none .ic { width: 1.6rem; height: 1.6rem; }
.ev-thumb.none small { font-size: .72rem; }
.ev-thumb.broken img { display: none; }
@media (max-width: 900px) and (min-width: 600px) { .ev-thumb { width: 6.5rem; height: 4.8rem; } }
@media (max-width: 599px) {
  .ev > .ev-thumb { grid-column: 1; width: 3.8rem; height: 3.8rem; border-radius: 10px; }
  .ev > .ev-thumb.none { display: none; }
  .ev-thumb .cnt { font-size: .68rem; right: .15rem; bottom: .15rem; }
}
@media (min-width: 600px) { .ev > .chip { min-width: 7.6rem; justify-content: center; text-align: center; flex: none; } }

/* Nút Đường đi trên thẻ địa danh (1.5.2) */
.ncard-act { display: flex; justify-content: flex-end; padding: 0 1rem .9rem; margin-top: -.2rem; }
.ncard-act .btn.route { gap: .4rem; min-height: 2.8rem; font-size: 1rem; padding: .2rem 1rem; }
.ncard-act .btn.route .ic { width: 1.15rem; height: 1.15rem; }

/* Người nữ: màu xanh lá nhạt trên mọi kiểu xem cây (1.5.3) */
.pcard.female { background: #e3f5df; border-color: #93cf8b; }
.pcard.female .nm { color: #1f4a1b; }
.pcard.female.dead { background: #dbe7d8; border-color: #7ea779; }
.pcard.female.dead .nm { color: #2b4428; }
.fcard.female { background: #e3f5df; border-color: #93cf8b; }
.fcard.female.dead { background: #dbe7d8; border-color: #7ea779; }
.pcard.female.sel { background: var(--brand-soft); border-color: var(--brand); }
.fcenter.female { background: #e3f5df; }
.rel-chip.female { background: #e3f5df; border-color: #93cf8b; color: #1f4a1b; }

/* Chia sẻ lễ / giỗ: mã QR, link, Zalo, Facebook (1.5.5) */
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .25rem; }
.share-bar { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.sb-btn { display: inline-flex; align-items: center; gap: .3rem; min-height: 2.3rem; padding: .15rem .65rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--brand-dark); font-weight: 700; font-size: .86rem; cursor: pointer; }
.sb-btn:hover, .sb-btn:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.sb-btn .ic { width: 1.05rem; height: 1.05rem; }
.share-bar.big .sb-btn { min-height: 2.9rem; font-size: 1rem; padding: .2rem 1rem; }
.brand-z, .brand-f { display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 5px; color: #fff; font: 800 .78rem/1 system-ui, sans-serif; }
.brand-z { background: #0068ff; }
.brand-f { background: #1877f2; border-radius: 50%; font-size: .9rem; }
.sb-btn.zalo { color: #0050c8; }
.sb-btn.fb { color: #1259c3; }
.btn.zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.btn.fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn.zalo .brand-z, .btn.fb .brand-f { background: #fff; color: #0068ff; }
.btn.fb .brand-f { color: #1877f2; }
.share-row { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: .4rem; }
@media (max-width: 599px) {
  .ev > .ev-foot, .ev .ev-foot { width: 100%; }
  .sb-btn { padding: .15rem .55rem; font-size: .82rem; }
}

/* Sắp xếp thứ tự anh chị em (1.5.6) */
.order-list { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; max-height: 60vh; overflow: auto; }
.order-row { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto auto; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.order-row .no { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
.order-row .nm { min-width: 0; display: flex; flex-direction: column; }
.order-row .nm small { color: var(--text-2); }
.order-row .btn.sm { min-width: 2.8rem; min-height: 2.8rem; font-size: 1.1rem; }
.order-row.me { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.order-row.female { background: #e3f5df; border-color: #93cf8b; }
.order-row.female.me { border-color: var(--brand); }

/* Nút + / − gập mở nhánh trên phả đồ (1.5.8) */
.pado .pd-fold { cursor: pointer; }
.pado .pd-fold:hover circle:nth-of-type(2) { filter: brightness(1.15); stroke-width: 3; }
.tree-bar .keep-t .t { display: inline !important; }
.tree-bar .keep-t > span[aria-hidden] { font-size: 1.15em; line-height: 1; }
.app-ver { text-align: center; color: var(--text-2); font-size: .85rem; margin: 1.2rem 0 2rem; }

/* Final 1.0.2 — bố cục riêng của nhánh: chọn xếp ngang 1–5 đời sau */
.node-menu { max-height: calc(100vh - 16px); overflow-y: auto; }
.nm-chips { display: flex; flex-wrap: wrap; gap: .35rem; padding: .25rem .6rem .45rem; }
.nm-chip { min-height: 2.5rem; min-width: 3.4rem; padding: 0 .7rem; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; }
.nm-chip:hover, .nm-chip:focus-visible { background: var(--brand-soft); outline: none; }
.nm-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Final 1.0.3 — hộp "Đặt lại cách xem" */
.rv-list { margin: .3rem 0 .8rem 1.2rem; padding: 0; line-height: 1.55; }
.rv-list li { margin: .15rem 0; }
.rv-chk { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--brand-soft); margin: .2rem 0 .6rem; cursor: pointer; }
.rv-chk input { width: 1.3rem; height: 1.3rem; flex: none; margin-top: .15rem; }

/* ===== Final 1.0.4 — Phân loại giỗ chạp + dòng chữ chạy ===== */
.muc-tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin: 0 0 .7rem; }
.muc-tab { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: .35rem .95rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: 1rem; cursor: pointer; }
.muc-tab .n { min-width: 1.7rem; padding: 0 .45rem; border-radius: 999px; background: rgba(0,0,0,.1); font-size: .88rem; text-align: center; line-height: 1.6; }
.muc-tab.m-thuong { background: #e3f0fb; border-color: #9cc7ec; color: #0d3d66; }
.muc-tab.m-to { background: #b3121b; border-color: #b3121b; color: #ffd84d; }
.muc-tab.m-to .n { background: #ffd84d; color: #8a0d14; }
.muc-tab.m-ho { background: #ffe680; border-color: #e3c23a; color: #111; }
.muc-tab.m-ho .ev-star { color: #d10f1b; }
.muc-tab.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-dark); }
.muc-tab.m-all.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.muc-tab.m-all.on .n { background: rgba(255,255,255,.25); }
.ev-star { display: inline-block; line-height: 1; }
@keyframes gp-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes gp-glow { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 10px rgba(255,216,77,.9); } }
.ev-muc-lbl { display: flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; margin-bottom: .1rem; }
/* Giỗ thường: xanh dương nhạt */
.ev.ev-muc-thuong, .gio-card.ev-muc-thuong { background: #e3f0fb; border-color: #b9d8f3; }
.ev.ev-muc-thuong .ev-muc-lbl { color: #1d5a92; }
/* Giỗ Tổ - Lễ lớn: nền đỏ, chữ vàng, sao nhấp nháy */
.ev.ev-muc-to, .gio-card.ev-muc-to { background: #b3121b; border-color: #8a0d14; color: #ffd84d; }
.ev.ev-muc-to .muted, .gio-card.ev-muc-to .muted, .ev.ev-muc-to .ev-meta, .gio-card.ev-muc-to .ev-meta { color: #ffe9a6; }
.ev.ev-muc-to .ev-meta a.link, .ev.ev-muc-to .ev-meta a.tel, .gio-card.ev-muc-to .ev-meta a.link, .gio-card.ev-muc-to .ev-meta a.tel { color: #fff3c4; }
.ev.ev-muc-to .date { background: #ffd84d; }
.ev.ev-muc-to .date b, .ev.ev-muc-to .date small { color: #8a0d14; }
.ev-muc-to .ev-title { color: #ffd84d; animation: gp-glow 1.6s ease-in-out infinite; }
.ev-muc-to .ev-star, .muc-tab.m-to .ev-star, .tk-i.m-to .tk-star { color: #ffd84d; animation: gp-blink 1s steps(2, start) infinite; }
.ev-muc-to .ev-muc-lbl { color: #ffd84d; }
.gio-card.ev-muc-to h1 { color: #ffd84d; }
/* Lễ dòng họ: nền vàng, chữ đen, sao đỏ */
.ev.ev-muc-ho, .gio-card.ev-muc-ho { background: #ffe680; border-color: #e3c23a; color: #111; }
.ev.ev-muc-ho .muted, .gio-card.ev-muc-ho .muted, .ev.ev-muc-ho .ev-meta, .gio-card.ev-muc-ho .ev-meta { color: #222; }
.ev.ev-muc-ho .ev-title, .gio-card.ev-muc-ho h1 { color: #000; }
.ev-muc-ho .ev-star, .tk-i.m-ho .tk-star { color: #d10f1b; }
.ev-muc-ho .ev-muc-lbl { color: #000; }
.ev.ev-muc-ho .date { background: #fff7c7; }
.muc-chip { font-weight: 800; }
.ev-muc-to .muc-chip { background: #ffd84d; color: #8a0d14; }
.ev-muc-ho .muc-chip { background: #111; color: #ffe680; }
.ev-muc-ho .muc-chip .ev-star { color: #ff4a52; }
.ev-muc-thuong .muc-chip { background: #fff; color: #1d5a92; }
/* Nút tích mức độ (người quản trị) */
.muc-ticks { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.muc-tick { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.3rem; padding: .2rem .7rem .2rem .4rem; border-radius: 999px;
  border: 1.5px solid rgba(0,0,0,.25); background: #fff; color: #222; font-size: .88rem; font-weight: 700; cursor: pointer; }
.muc-tick .box { width: 1.2rem; height: 1.2rem; border-radius: 5px; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; line-height: 1; }
.muc-tick.m-thuong.on { background: #cfe4f8; border-color: #1d5a92; color: #0d3d66; }
.muc-tick.m-to.on { background: #b3121b; border-color: #ffd84d; color: #ffd84d; }
.muc-tick.m-ho.on { background: #ffe680; border-color: #111; color: #111; }
.muc-tick:focus-visible, .muc-tab:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 2px; }
/* Dòng chữ chạy trên thanh đầu */
.top-ticker { flex: 1 1 auto; min-width: 0; height: 2.5rem; display: flex; align-items: center; overflow: hidden; border-radius: 999px;
  background: rgba(0,0,0,.22); color: #fff; text-decoration: none; font-size: .95rem; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.top-ticker[hidden] { display: none; }
.topbar.has-ticker .brand { flex: 0 0 auto; max-width: min(30%, 21rem); }
.topbar.has-ticker .top-search, .topbar.has-ticker .icon-btn { flex: none; }
.tk-track { display: inline-flex; animation: gp-marquee 40s linear infinite; will-change: transform; }
.top-ticker:hover .tk-track, .top-ticker:focus-visible .tk-track { animation-play-state: paused; }
.tk-run { display: inline-flex; flex: none; }
.tk-i { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .9rem; margin-right: .6rem; border-radius: 999px; }
.tk-i.m-to { background: #b3121b; color: #ffd84d; }
.tk-i.m-ho { background: #ffe680; color: #111; }
@keyframes gp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .top-ticker { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .tk-run[aria-hidden] { display: none; }
}
@media (max-width: 599px) {
  .topbar.has-ticker .brand { flex: none; max-width: none; }
  .topbar.has-ticker .brand > span { display: none; }
  .top-ticker { height: 2.3rem; font-size: .88rem; }
  .muc-tab { padding: .3rem .7rem; font-size: .92rem; }
}
@media (max-width: 599px) {
  .muc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
  .muc-tab { justify-content: center; padding: .3rem .5rem; font-size: .9rem; min-width: 0; }
  .muc-tab .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

/* ===== Final 1.0.5 — Nhánh chính / nhánh con ===== */
.nav-sub2 { display: flex; flex-direction: column; gap: .1rem; margin: 0 0 .15rem .85rem; padding-left: .5rem; border-left: 2px dashed var(--line-strong); }
.nav-sub-item.child { font-size: .9rem; min-height: 2.2rem; }
.nav-sub-item.has-kids .nm { font-weight: 800; }
.nav-sub-item.child .dot { width: .5rem; height: .5rem; }
.tp-role { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .7rem; border-radius: 999px; font-size: .9rem; font-weight: 700; border: 1.5px solid currentColor; background: var(--surface); }
.tp-role.chinh { color: #8a5a00; background: #fff4cf; }
.tp-role.con { color: #1f7a8c; cursor: pointer; }
.tp-role.con:hover { background: #e3f4f7; }
.role-choices .choice b { font-size: .98rem; }
.role-choices { margin: .2rem 0 .3rem; }
.role-choices .choice { display: flex; flex-direction: row; align-items: flex-start; }
.role-choices .choice input { width: 1.3rem; min-width: 1.3rem; height: 1.3rem; min-height: 0; flex: none; padding: 0; margin-top: .15rem; }

/* Final 1.0.6 — tên cây gia phả cạnh tên người được giỗ */
.ev-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .55rem; row-gap: .1rem; }
.ev-cay { font-size: .82rem; font-weight: 600; color: var(--muted); padding: .05rem .55rem; border: 1px solid currentColor; border-radius: 999px; white-space: normal; line-height: 1.5; }
.ev.ev-muc-to .ev-cay { color: #ffe9a6; }
.ev.ev-muc-ho .ev-cay { color: #333; }
.ev.ev-muc-thuong .ev-cay { color: #1d5a92; }
/* Final 1.0.7 — slide bản tin trang chủ chỉ Giỗ Tổ - Lễ lớn, Lễ dòng họ */
.hero-slide.m-to .hero-muc { background: #b3121b; color: #ffd84d; border-color: #b3121b; }
.hero-slide.m-ho .hero-muc { background: #ffe680; color: #111; border-color: #e3c23a; }

/* Final 1.0.8 — tab Giỗ chạp, Thờ tự - mồ mả trong trang Gia phả */
.tree-bar .seg { flex-wrap: wrap; }
.rec-view { padding-top: .4rem; }
.rec-group { margin-bottom: .8rem; }
.rec-group h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1.1rem; }
.rec-list { display: flex; flex-direction: column; gap: .4rem; }
.rec-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rec-row.col { flex-direction: column; align-items: stretch; }
.rec-date { min-width: 3.6rem; text-align: center; background: #e3f0fb; border-radius: 10px; padding: .25rem .3rem; line-height: 1.15; }
.rec-date b { display: block; font-size: 1.35rem; color: #1d5a92; }
.rec-date small { font-size: .75rem; color: #1d5a92; }
.rec-main { flex: 1; min-width: 12rem; display: flex; flex-direction: column; gap: .1rem; }
.rec-name { font-weight: 800; font-size: 1.05rem; text-align: left; background: none; border: 0; padding: 0; color: var(--brand-dark); cursor: pointer; }
.rec-name:hover { text-decoration: underline; }
.rec-sub { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .35rem .2rem 0; border-top: 1px dashed var(--line); }
.rec-sub > span:nth-child(2) { flex: 1; min-width: 12rem; }
.rec-ic { font-size: 1.2rem; }
.chip.ok { background: #dff3dc; color: #1f6b1a; margin-left: .4rem; }

/* 1.0.9: câu hỏi xác nhận Có / Không (tạo nhánh con, đồng bộ lên nhánh chính) */
.yn-box { border: 1px solid var(--line-strong); border-radius: 14px; padding: .7rem .9rem; margin: .6rem 0; display: grid; gap: .55rem; background: var(--surface-2, transparent); }
.yn-head { font-weight: 700; }
.yn-info { margin: 0; }
.yn { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.yn-q { flex: 1 1 15rem; min-width: 0; }
.yn-q small { display: block; line-height: 1.35; }
.yn-opts { display: flex; gap: .4rem; flex: none; }
.yn-opt { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 2px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-weight: 600; min-height: 2.4rem; }
.yn-opt input { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--brand); }
.yn-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink, inherit); }

/* 1.1.0: kéo ra / kéo vào thanh menu bên trái (máy tính ≥ 1100px) */
.nav-grip { display: none; }
@media (min-width: 1100px) {
  .nav-grip {
    display: block; position: fixed; z-index: 6; top: var(--top-h); bottom: 0;
    left: calc(var(--nav-w) - 5px); width: 10px; cursor: col-resize; touch-action: none; outline: none;
  }
  .nav-grip::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .15s;
  }
  .nav-grip::before {
    content: ''; position: absolute; top: 50%; left: 2px; width: 6px; height: 2.6rem; margin-top: -1.3rem;
    border-radius: 6px; background: var(--line-strong); opacity: .55; transition: opacity .15s, background .15s;
  }
  .nav-grip:hover::after, .nav-grip:focus-visible::after, html.nav-dragging .nav-grip::after { background: var(--brand); }
  .nav-grip:hover::before, .nav-grip:focus-visible::before, html.nav-dragging .nav-grip::before { opacity: 1; background: var(--brand); }
  html.nav-dragging, html.nav-dragging * { cursor: col-resize !important; user-select: none !important; }
  .nav { overflow-x: hidden; }
  .nav-item > span:not(.badge) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-item .ic { flex: none; }
}
html.tree-fs .nav-grip { display: none; }

/* 1.1.1: nhánh con — luồng các đời trên ở nhánh chính (Xem dọc) */
.upline { display: flex; flex-direction: column; align-items: flex-start; margin: 0 0 .3rem .2rem; padding-left: 1.1rem; border-left: 3px dashed var(--line-strong); }
.upline-head { font-size: .82rem; font-style: italic; font-weight: 700; color: var(--brand); margin: 0 0 .35rem -.6rem; }
.upline-item { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .5rem; margin: 0 0 .4rem; padding: .35rem .8rem; position: relative;
  border: 1.6px dashed var(--brand); border-radius: 12px; background: #fbefe0; color: var(--brand); text-decoration: none; font-size: calc(.95rem * var(--tz, 1)); }
.upline-item::before { content: ''; position: absolute; left: -1.1rem; top: 50%; width: 1rem; border-top: 3px dashed var(--line-strong); }
.upline-item.dead { background: #ece3da; color: #4f4038; }
.upline-item.female { background: #e8f5e5; border-color: #5fa858; color: #1f4a1b; }
.upline-item small { color: var(--text-2); font-weight: 600; }
.upline-item .code { font-weight: 700; color: #b07a4a; font-size: .85em; }
.upline-item:hover, .upline-item:focus-visible { background: var(--brand-soft); }

/* 1.1.2: ô nổi "Theo dòng thời gian" — xem nhanh ký sự trên trang chủ (mo / to / an) */
.kp { position: fixed; z-index: 22; display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1.5px solid var(--line-strong); border-radius: 18px; box-shadow: 0 12px 40px rgba(60,30,5,.28); overflow: hidden; }
.kp-mo { right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); height: min(72vh, 660px); }
.kp-to { top: calc(var(--top-h) + 12px); bottom: 12px; left: calc(var(--nav-w) + 16px); right: 16px; }
.kp-an { right: 16px; bottom: 16px; background: none; border: 0; box-shadow: none; overflow: visible; }
.kp-pill { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--tap, 3rem); padding: 0 1.1rem; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 1rem; box-shadow: 0 8px 24px rgba(60,30,5,.35); cursor: pointer; }
.kp-pill .ic { width: 1.3rem; height: 1.3rem; }
.kp-count { background: #fff; color: var(--brand); border-radius: 999px; padding: 0 .5rem; font-size: .85rem; line-height: 1.5; }
.kp-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .7rem .6rem 1rem; background: var(--brand); color: #fff; flex: none; }
.kp-title { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.kp-title .ic { width: 1.5rem; height: 1.5rem; flex: none; }
.kp-title b { display: block; font-size: 1.05rem; line-height: 1.2; }
.kp-title small { display: block; opacity: .85; font-size: .8rem; }
.kp-tools { display: flex; gap: .3rem; flex: none; }
.kp-btn { width: 2.5rem; height: 2.5rem; border-radius: 12px; border: 0; background: rgba(255,255,255,.18); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.kp-btn:hover, .kp-btn:focus-visible { background: rgba(255,255,255,.32); }
.kp-btn .ic { width: 1.25rem; height: 1.25rem; }
.kp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.kp-list, .kp-read { overflow: auto; min-height: 0; padding: .4rem .8rem .8rem; }
.kp-mo .kp-read { display: none; }
.kp-mo.reading .kp-list { display: none; }
.kp-mo.reading .kp-read { display: block; }
.kp-to .kp-body { grid-template-columns: minmax(300px, 380px) 1fr; }
.kp-to .kp-list { border-right: 1px solid var(--line); }
.kp-to .kp-read { padding: 1rem 1.6rem; }
.kp-to .kp-back { display: none; }
.kp-year { position: sticky; top: -.4rem; background: var(--surface); font-weight: 800; color: var(--brand); padding: .5rem 0 .3rem; z-index: 1; font-size: .9rem; }
.kp-item { display: flex; align-items: flex-start; gap: .7rem; width: 100%; text-align: left; background: none; border: 0; padding: .55rem .2rem .55rem 1.3rem;
  position: relative; cursor: pointer; color: inherit; border-radius: 12px; border-left: 2px solid var(--line-strong); margin-left: .45rem; }
.kp-item:hover, .kp-item:focus-visible, .kp-item.on { background: var(--brand-soft); }
.kp-dot { position: absolute; left: -.5rem; top: .95rem; width: .85rem; height: .85rem; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--brand); }
.kp-it { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.kp-it small { color: var(--text-2); font-size: .8rem; }
.kp-it b { font-size: .98rem; line-height: 1.3; }
.kp-sum { font-size: .85rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-item img { width: 4.2rem; height: 3.2rem; object-fit: cover; border-radius: 8px; flex: none; }
.kp-empty { padding: 1rem .2rem; }
.kp-art h3 { margin: .5rem 0 .2rem; font-size: 1.2rem; }
.kp-to .kp-art h3 { font-size: 1.5rem; }
.kp-art .lead { font-weight: 600; }
.kp-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .4rem; margin: .7rem 0; }
.kp-to .kp-imgs { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.kp-img { padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4/3; background: var(--brand-soft); }
.kp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kp-foot { flex: none; border-top: 1px solid var(--line); padding: .5rem 1rem; font-size: .9rem; text-align: right; background: var(--surface-2); }
@media (max-width: 599px) {
  .kp-mo { left: 8px; right: 8px; width: auto; bottom: calc(var(--bnav-h, 4.4rem) + 8px + env(safe-area-inset-bottom)); height: 62vh; }
  .kp-an { right: 10px; bottom: calc(var(--bnav-h, 4.4rem) + 10px + env(safe-area-inset-bottom)); }
  .kp-to { inset: 0; border-radius: 0; z-index: 40; }
  .kp-to .kp-body { grid-template-columns: 1fr; }
  .kp-to .kp-read { display: none; padding: .6rem .9rem; }
  .kp-to.reading .kp-list { display: none; }
  .kp-to.reading .kp-read { display: block; }
  .kp-to .kp-back { display: inline-flex; }
}
@media (min-width: 600px) and (max-width: 899px) { .kp-to .kp-body { grid-template-columns: 1fr; } .kp-to.reading .kp-list { display: none; } .kp-to .kp-back { display: inline-flex; } .kp-to:not(.reading) .kp-read { display: none; } }
@media print { .kp { display: none; } }

/* 1.1.3: nút Check-in trên thẻ địa danh + hộp đăng bài check-in */
.ncard-act { justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.ncard-act .checkin-btn { gap: .4rem; min-height: 2.8rem; font-size: 1rem; padding: .2rem 1rem; border: 2px solid var(--brand); color: var(--brand); font-weight: 700; }
.ncard-act .checkin-btn .ic { width: 1.15rem; height: 1.15rem; }
.checkin-place { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; margin-bottom: .8rem; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); }
.checkin-place .ic { width: 1.6rem; height: 1.6rem; flex: none; }

/* ===== Final 1.1.6: Lịch sử cập nhật · Quy ước · Niên giám · tìm theo chi ===== */
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand-dark); cursor: pointer; text-align: left; }
.linkish:hover { text-decoration: underline; }
.chi-pick { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.chi-pick select { min-height: 2.8rem; border-radius: 10px; border: 2px solid var(--line-strong); padding: 0 .6rem; background: #fff; max-width: 100%; }
.doc-view { max-width: 60rem; }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin-bottom: .4rem; }
.doc-head h2 { margin: 0; font-size: 1.3rem; }
.doc-head .row { gap: .5rem; flex-wrap: wrap; align-items: center; }
.chk { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.chk input { width: 1.2rem; height: 1.2rem; }
.doc-card { padding: 1rem 1.3rem; }
.rules h3 { margin: 1.1rem 0 .3rem; color: var(--brand-dark); font-size: 1.12rem; }
.rules h3:first-child { margin-top: 0; }
.his-list { display: flex; flex-direction: column; }
.his-day { position: sticky; top: 0; z-index: 1; background: var(--bg, #fff); font-weight: 800; color: var(--brand); padding: .6rem 0 .3rem; border-bottom: 2px solid var(--line); }
.his-row { display: flex; gap: .7rem; padding: .6rem .2rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.his-ic { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; }
.his-main { min-width: 0; }
.his-main .chip { margin-left: .4rem; }
.ng-toc { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.ng-year { display: grid; grid-template-columns: 5.2rem 1fr; gap: .8rem; padding: .6rem 0; border-top: 2px solid var(--line); scroll-margin-top: 1rem; }
.ng-y { font-size: 1.6rem; font-weight: 800; color: var(--brand); line-height: 1.2; position: sticky; top: .4rem; align-self: start; }
.ng-items { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.ng-item { padding: .8rem 1rem; margin: 0; }
.ng-item h3 { margin: 0 0 .15rem; font-size: 1.12rem; }
.ng-item .slider, .ng-slide { margin: .6rem 0; max-width: 36rem; }
.ng-auto { font-size: .95rem; padding: .35rem .7rem; border-radius: 10px; background: var(--brand-soft); }
.ng-auto.mat { background: #ece3da; }
.ng-auto .linkish { font-weight: 600; }
.sr-row { display: flex; align-items: center; gap: .4rem; border-bottom: 1px solid var(--line); }
.sr-row .li-btn { flex: 1; min-width: 0; }
.sr-act { display: flex; gap: .35rem; flex: none; }
@media (max-width: 599px) {
  .ng-year { grid-template-columns: 1fr; gap: .3rem; }
  .ng-y { position: static; font-size: 1.35rem; }
  .sr-row { flex-wrap: wrap; padding-bottom: .5rem; }
  .sr-act { width: 100%; padding-left: 3.4rem; }
  .doc-head h2 { font-size: 1.12rem; }
}

/* ===== Final 1.1.7: tìm trên tất cả các cây gia phả ===== */
.sr-scope-row { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 .2rem; flex-wrap: wrap; }
.sr-scope { flex: 1; min-width: 14rem; min-height: 2.9rem; border-radius: 10px; border: 2px solid var(--brand); padding: 0 .6rem; background: #fff; font-weight: 700; color: var(--brand-dark); max-width: 100%; }
.chi-box[hidden] { display: none; }
.sr-group { margin: .9rem 0 .2rem; padding: .4rem .7rem; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); }
.sr-tree { display: inline-block; margin-top: .2rem; font-size: .82rem; font-weight: 700; color: #1f7a8c; background: #e3f3f5; border-radius: 999px; padding: .05rem .55rem; }
.sr-row.female .avatar { background: #e3f5df; color: #1f4a1b; }

/* ===== Final 1.1.8: node nhấp nháy khi mở hồ sơ từ kết quả tìm kiếm ===== */
@keyframes pnFlash { from { opacity: 1; filter: drop-shadow(0 0 0 rgba(242, 183, 5, 0)); } to { opacity: .2; filter: drop-shadow(0 0 10px rgba(242, 183, 5, 1)); } }
.pn.flash { animation: pnFlash .5s ease-in-out 12 alternate; }
.pn.flash rect { stroke: #f2b705 !important; stroke-width: 4px !important; }
@keyframes cardFlash { from { box-shadow: 0 0 0 0 rgba(242, 183, 5, .9); background: #fff4c2; } to { box-shadow: 0 0 0 8px rgba(242, 183, 5, .25); background: #ffd84d; } }
.pcard.flash { animation: cardFlash .5s ease-in-out 12 alternate; outline: 3px solid #f2b705; }
@media (prefers-reduced-motion: reduce) { .pn.flash, .pcard.flash { animation-duration: 1s; animation-iteration-count: 4; } }

/* ===== Final 1.1.9: thống kê nhân sự theo đời trên nhiều cây gia phả ===== */
.gs-switch { margin: .4rem 0 .8rem; }
.gs-view { max-width: 72rem; }
.gs-panel { padding: .9rem 1.1rem; }
.gs-lbl { font-weight: 800; color: var(--brand-dark); margin: .2rem 0 .45rem; }
.gs-lbl + .gs-trees + .gs-lbl { margin-top: .8rem; }
.gs-trees { display: flex; flex-wrap: wrap; gap: .45rem; }
.gs-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem .35rem .55rem; border-radius: 999px; border: 2px solid var(--line-strong); background: #fff; cursor: pointer; font-weight: 600; min-height: 2.6rem; }
.gs-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.gs-chip.sub { font-weight: 500; }
.gs-chip input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.gs-filters { gap: .5rem; flex-wrap: wrap; align-items: center; }
.gs-filters select { min-height: 2.8rem; border-radius: 10px; border: 2px solid var(--line-strong); padding: 0 .6rem; background: #fff; }
.gs-doiwrap { display: inline-flex; gap: .3rem; align-items: center; }
.gs-doi { font-weight: 800; color: var(--brand-dark); border-color: var(--brand) !important; min-width: 11rem; }
.gs-sum { margin: 1rem 0 .6rem; }
.gs-big { font-size: 1.35rem; margin-bottom: .5rem; }
.gs-big b { color: var(--brand); }
.gs-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.gs-stat { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; display: flex; flex-direction: column; }
.gs-stat b { font-size: 1.4rem; color: var(--brand-dark); line-height: 1.2; }
.gs-stat span { font-size: .9rem; color: var(--muted); }
.gs-pertree { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 .2rem; }
.gs-tools { gap: .5rem; margin-top: .6rem; }
.gs-tree { margin: 1rem 0; scroll-margin-top: 1rem; }
.gs-th { font-size: 1.1rem; margin: 0 0 .4rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.gs-table { width: 100%; border-collapse: collapse; background: var(--surface, #fff); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.gs-table th { text-align: left; background: var(--brand-soft); color: var(--brand-dark); padding: .5rem .6rem; font-size: .92rem; }
.gs-table td { padding: .45rem .6rem; border-top: 1px solid var(--line); vertical-align: middle; }
.gs-table td.num { text-align: right; color: var(--muted); width: 1%; white-space: nowrap; }
.gs-table td.name { display: flex; align-items: center; gap: .55rem; }
.gs-table td.name .chip { margin-left: .35rem; }
.gs-table td.act { white-space: nowrap; text-align: right; }
.gs-table td.act .btn { margin-left: .3rem; }
.gs-table tr.female td.name b { color: #1f4a1b; }
.gs-table .avatar.sm, .gs-table .avatar { width: 2.2rem; height: 2.2rem; font-size: .9rem; flex: none; }
.gs-table tr.female .avatar { background: #e3f5df; color: #1f4a1b; }
@media (max-width: 760px) {
  .gs-table thead { display: none; }
  .gs-table, .gs-table tbody, .gs-table tr, .gs-table td { display: block; width: 100%; }
  .gs-table tr { padding: .5rem .7rem; border-top: 1px solid var(--line); }
  .gs-table td { border: 0; padding: .1rem 0; }
  .gs-table td[data-l]:not(.name):not(:first-child)::before { content: attr(data-l) ': '; color: var(--muted); font-size: .88rem; }
  .gs-table td:empty { display: none; }
  .gs-table td.num:first-child { display: none; }
  .gs-table td.num { text-align: left; }
  .gs-table td.act { text-align: left; padding-top: .35rem; }
  .gs-table td.act .btn { margin: 0 .3rem 0 0; }
  .gs-switch button { white-space: normal; text-align: left; }
}

/* ===== Final 1.2.1: anh chị em cùng đời khi xem một chi ===== */
.sib-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .3rem 0 .8rem; padding: .5rem .7rem; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: #fffaf3; }
.sib-row .lbl { font-weight: 800; color: var(--brand-dark); margin-right: .2rem; }
.sib-chip { display: inline-flex; align-items: center; padding: .25rem .75rem; border-radius: 999px; border: 2px dashed var(--brand); background: #fbefe0; color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.sib-chip.female { background: #e3f5df; border-color: #93cf8b; color: #1f4a1b; }
.sib-chip.dead { background: #ece3da; }
.sib-chip.self { border-style: solid; background: var(--brand); color: #fff; }
.sib-chip small { font-weight: 500; opacity: .85; }
a.sib-chip:hover { background: var(--brand-soft); }
.pn-sib { cursor: pointer; }
/* 1.2.2: nút Tạo / Mở gia phả riêng ở dải "Đang xem nhánh" */
.okbox.row { flex-wrap: wrap; gap: .5rem; }
.own-tree { gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .own-tree { width: 100%; justify-content: flex-start; } }
/* 1.2.3: Trang chủ hiện tên nơi người dùng đang truy cập */
.loc-title { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.loc-pin { font-size: .8em; }
.loc-src { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .2rem; }
.linkbtn { background: none; border: 0; padding: .3rem 0; min-height: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; }
.linkbtn:hover, .linkbtn:focus-visible { color: var(--brand-dark); }
.welcome a.chip { text-decoration: none; color: inherit; }

/* 1.2.5: anh em cùng đời ở mọi kiểu xem; hàng anh em không tràn khỏi màn hình ở Xem dọc */
.tree .sib-row { max-width: min(60rem, calc(100vw - var(--nav-w, 0px) - 3rem)); }
.tp-search { margin-left: auto; }
a.fcard.far { text-decoration: none; color: inherit; border-style: dashed; }
a.fcard.far:hover { border-color: var(--brand); }

/* 1.2.6: toàn màn hình giữ ở mọi tab; ẩn / hiện thanh công cụ để xem gia phả trọn màn hình */
.fs-tools { background: #fff; color: var(--brand-dark); border: 2px solid var(--brand) !important; }
html.tree-fs.fs-notools .tree-pick, html.tree-fs.fs-notools .tree-bar { display: none !important; }
/* 1.2.7: Danh mục chi họ (thanh mục con) + Ban liên lạc */
.seg .cat-tab { font-weight: 800; }
.cat-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 1rem; }
.cat-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 3rem; padding: .4rem 1rem; border-radius: 14px;
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--brand-dark); font-weight: 700; font-size: 1rem; cursor: pointer; }
.cat-btn:hover { border-color: var(--brand); }
.cat-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-ic { font-size: 1.15em; }
@media (max-width: 599px) { .cat-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .cat-btn { flex: none; white-space: nowrap; } }
.bcn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: .8rem; }
.bcn-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; }
.bcn-card.female { background: #f2faf0; }
.bcn-card .avatar.lg { flex: none; object-fit: cover; }
.bcn-main { min-width: 0; flex: 1; display: grid; gap: .25rem; }
.bcn-main h3 { margin: 0; font-size: 1.15rem; }
.bcn-role { justify-self: start; background: var(--brand); color: #fff; font-weight: 800; }
.bcn-act { gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.bcn-results { display: grid; gap: .3rem; max-height: 16rem; overflow: auto; margin: -.3rem 0 .6rem; }
.bcn-hit { text-align: left; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.bcn-hit:hover, .bcn-hit.on { border-color: var(--brand); background: var(--brand-soft); }
.bcn-picked { margin-bottom: .6rem; }

/* ---- Lịch sử chi - họ: blog ---- */
.blog-q{min-width:12rem;flex:1 1 12rem;max-width:20rem;padding:.55rem .8rem;border:1px solid var(--line,#d9cdb8);border-radius:.6rem;font:inherit;background:var(--surface,#fff)}
.blog-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(17rem,1fr));gap:1rem;margin-top:.5rem}
.blog-list>.empty{grid-column:1/-1}
.blog-card{padding:0;overflow:hidden;cursor:pointer;display:flex;flex-direction:column;transition:transform .15s,box-shadow .15s}
.blog-card:hover,.blog-card:focus-visible{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.12)}
.blog-card.pinned{outline:2px solid var(--accent,#b8860b)}
.blog-cover{aspect-ratio:16/9;background:var(--surface-2,#f3efe6);display:flex;align-items:center;justify-content:center;font-size:2.6rem}
.blog-cover.none{aspect-ratio:auto;height:4.5rem;font-size:2rem}
.blog-cover img{width:100%;height:100%;object-fit:cover;display:block}
.blog-body{padding:.75rem .9rem 1rem}
.blog-body h3{margin:0 0 .25rem;font-size:1.08rem;line-height:1.35}
.blog-pin{font-size:.72rem;margin-right:.35rem;vertical-align:middle}
.blog-sum{margin:.45rem 0 0;color:var(--muted,#555);font-size:.92rem;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.blog-read{font-size:1.02rem;line-height:1.7}
.blog-lead{font-style:italic;color:var(--muted,#555);border-left:3px solid var(--accent,#b8860b);padding-left:.7rem}
.blog-slide{margin:.6rem 0 1rem}
@media (max-width:520px){.blog-list{grid-template-columns:1fr}.blog-q{max-width:none}}

/* 1.3.1: kế thừa Thông tin dòng họ khi tạo nhánh con */
.ke-box { border-top: 1px dashed var(--line-strong); padding-top: .55rem; display: grid; gap: .45rem; }
.ke-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ke-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .4rem; }
.ke-row { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .6rem; border: 2px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.ke-row input { width: 1.2rem; height: 1.2rem; min-height: 0; margin: .15rem 0 0; padding: 0; flex: none; accent-color: var(--brand); }
.ke-row:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ke-row.off { opacity: .55; cursor: default; }
.ke-n { font-size: .85em; }

/* 1.3.1: nhánh dưới (cây nhánh con tách ra từ cây đang xem) */
.below-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: .4rem .6rem; }
.below-row .lbl { font-weight: 700; color: #1f7a8c; }
.below-chip { display: inline-flex; align-items: baseline; gap: .2rem; padding: .3rem .75rem; border: 1.5px dashed #1f7a8c; border-radius: 999px; background: #e3f1f4; color: #145866; font: inherit; cursor: pointer; text-decoration: none; }
.below-chip small { color: #3d6f78; font-weight: 600; }
.below-chip:hover, .below-chip:focus-visible { background: #cfe7ec; }
.below-kids { margin-top: .25rem; }
.below-kids > .below-chip { margin: .2rem 0 .35rem 1.6rem; }
.pcard.ext { display: inline-flex; flex-direction: column; padding: .35rem .75rem; border: 1.5px dashed #1f7a8c; border-radius: 10px; background: #e8f3f5; color: #145866; text-decoration: none; }
.pcard.ext.female { background: #e8f5e5; border-color: #5fa858; color: #1f4a1b; }
.pcard.ext.dead { background: #ece3da; color: #4f4038; }
.pcard.ext small { font-weight: 600; opacity: .85; }
.pn-up, .pn-below, .pn-tree { cursor: pointer; }
.sib-desc { margin-top: 1rem; padding-top: .6rem; border-top: 2px dashed var(--line-strong); display: grid; gap: .3rem; }

/* 1.3.4: Ký sự — 2 mục Ký sự Họ Mai / Lịch sử check-in */
.ks-tabs { margin-bottom: .8rem; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .4rem 0; }
.chip-row .lbl { font-weight: 700; color: var(--text-2); margin-right: .2rem; }
.chip.warn { background: #fff1d6; color: #8a5a00; }
.chip.ks-kieu { background: #f3e6d8; color: #8a3b0c; margin-right: .3rem; }
.chip.ks-kieu.blog { background: #e3f1f4; color: #145866; }
.ck-list { display: grid; gap: .6rem; }
.ck-month { font-weight: 800; color: var(--brand); margin-top: .6rem; border-bottom: 1px dashed var(--line-strong); padding-bottom: .2rem; }
.ck-item { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem; text-decoration: none; color: inherit; }
.ck-item img, .ck-ph { width: 7.5rem; height: 5.6rem; object-fit: cover; border-radius: 10px; flex: none; }
.ck-ph { display: flex; align-items: center; justify-content: center; background: var(--surface-2, #f3efe6); font-size: 2rem; }
.ck-item.draft { opacity: .75; }
.ck-body { display: grid; gap: .15rem; min-width: 0; }
.ck-place { color: #145866; }
@media (max-width: 520px) { .ck-item img, .ck-ph { width: 5.2rem; height: 4.2rem; } }
.ks-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .2rem; }

/* 1.3.5: menu con Ký sự trên thanh trái — máy tính rộng thì ẩn thanh tab trong trang */
.nav-sub-item .em { width: 1.1rem; text-align: center; flex: none; font-size: .9rem; }
@media (min-width: 1100px) { .ks-tabs { display: none; } }
/* 1.3.6: duyệt / công khai / ẩn bài ký sự và check-in ngay trong trang Ký sự */
.ks-item { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.ks-item > .ncard, .ks-item > .ck-item { flex: 1; border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.ks-act { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .7rem .6rem; border-top: 1px dashed var(--line-strong); background: #fbf6ee; }
.ks-act .btn.sm { min-height: 2.3rem; padding: .1rem .65rem; font-size: .86rem; }
.btn.ok { background: #2f7d32; border-color: #2f7d32; color: #fff; }
.btn.danger-t { color: #b3261e; }
.chip.st-an { background: #4a3b2d; color: #fff; }
.ncard.st-an, .ck-item.st-an { opacity: .55; filter: grayscale(.5); }
.ks-item:has(.st-cho) { border: 2px dashed var(--warn); }
.ks-tabs { display: flex; flex-wrap: nowrap; }
.ks-tabs button { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 0 .5rem; }
@media (max-width: 599px) {
  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
  .chip-row > * { flex: none; white-space: nowrap; }
}
.rel-chip.hot:not(.on) { border-color: var(--warn); color: var(--warn); }
.st-row { margin-bottom: .2rem; }
.pick-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; max-height: 60vh; overflow: auto; }
.pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 3rem; }
.pick-item:hover, .pick-item:focus-visible { background: var(--brand-soft); border-color: var(--brand); }
@media (min-width: 1100px) { .ks-tabs { display: none !important; } }
/* 1.3.8: bộ đếm lượt check-in + Xem lịch sử trên thẻ địa danh */
.pl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0 1rem .6rem; margin-top: auto; }
.pl-stat { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.8rem; padding: .3rem .6rem; border: 2px solid var(--line-strong); border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; font-weight: 700; font-size: .95rem; line-height: 1.15; text-align: center; }
.pl-stat b { font-size: 1.25rem; color: var(--brand); }
.pl-stat:hover, .pl-stat:focus-visible { border-color: var(--brand); background: #fff; }
.pl-stat.hist b { font-size: 1.05rem; }
.pl-stat span { white-space: nowrap; font-size: .86rem; }
.pl-stat { padding: .3rem .4rem; gap: .3rem; }
/* 1.3.9: hộp sắp xếp — các con bị tách nhóm */
.callout { border-radius: 12px; padding: .7rem .9rem; margin: .4rem 0 .6rem; border: 1px solid var(--line-strong); background: var(--surface); }
.callout.warn { background: #fff4e0; border-color: #e0a64a; }
.callout ul { margin: .35rem 0 .5rem; padding-left: 1.2rem; }

/* ---------- 1.4.0: Node đặc biệt (nhánh nổi tiếng) ---------- */
.pcard.spec-node { border-color: #e0a400; box-shadow: 0 0 0 3px #f4c84a; background: #fff8dc; }
.pcard.spec-line, .pcard.spec-sub { box-shadow: 0 0 0 2px #f0cf6e inset; }
.pcard.spec-line.linked, .pcard.spec-sub.linked { box-shadow: 0 0 0 2px #f0cf6e inset, 0 0 0 4px #1f7a8c; }
.pcard .spec-tag { font-size: .74em; font-weight: 700; color: #8a5a00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tkids.spec-only { border-left-color: #e0a400; border-left-style: dashed; }
.spec-more { display: block; margin: .2rem 0 .3rem 1.6rem; padding: .15rem .5rem; border: 1px dashed #c9a07a; border-radius: 999px; background: transparent; color: var(--text-2); font-size: .78rem; cursor: pointer; }
.spec-more:hover { background: var(--brand-soft); }
.btn.spec-btn:not(.ghost) { background: #e0a400; border-color: #e0a400; color: #fff; }
.btn.spec-btn.ghost span[aria-hidden] { color: #c58f00; }
.spec-card { border: 2px solid #f0cf6e; background: #fffbea; }
.spec-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem 0; border-top: 1px solid #f3e3b0; }
.spec-row b { color: #8a5a00; }
.spec-box { border: 2px solid #f0cf6e; background: #fffbea; padding: .55rem .8rem; }
.spec-box b { color: #8a5a00; }
.pd-tip .tip-spec { color: #ffd65c; font-weight: 700; }
.nm-item.spec-on { color: #8a5a00; font-weight: 700; }
/* 1.4.1: nhánh đặc biệt rẽ ra từ luồng các đời trên (Xem dọc) */
.upline-spec { margin: -.1rem 0 .5rem 1.4rem; padding: .3rem 0 .1rem .9rem; border-left: 3px solid #e0a400; }
.upline-spec-row { display: flex; align-items: center; gap: .3rem; }
.upline-item.spec-br { margin-bottom: .3rem; border-color: #f0cf6e; }
.upline-item.spec-br::before { left: -.95rem; width: .85rem; border-top: 2px solid #e0a400; }
.upline-item.spec-br.deep::before { display: none; }
.spec-elbow { color: #e0a400; font-weight: 700; margin-top: -.4rem; }
.upline-item.spec-node { background: #fff8dc; border: 2px solid #e0a400; color: #6b4300; }
/* 1.4.2: nút + / − thu mở nhánh con trong menu Gia phả (thanh trái) */
.nav-sub-item.nav-row { cursor: pointer; }
.nav-sub-item.nav-row .nm { flex: 0 1 auto; color: inherit; text-decoration: none; }
.nav-sub-item.nav-row .sp { flex: 1; }
.nav-tog { flex: none; width: 1.45rem; height: 1.45rem; padding: 0; border-radius: 50%; border: 2px solid var(--brand); background: #fff; color: var(--brand);
  font: 800 1rem/1 inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-tog[aria-expanded="false"] { background: var(--brand); color: #fff; }
.nav-tog:hover, .nav-tog:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
/* 1.4.3: nhãn nhóm các cụm cây (theo tỉnh) trên menu Gia phả */
.nav-grp { border-radius: 10px; margin: .1rem 0; }
.nav-grp-head { display: flex; align-items: center; gap: .45rem; padding: .3rem .5rem; border-radius: 10px; cursor: pointer; font-weight: 800; color: var(--brand-dark); background: #fbf1e3; }
.nav-grp-head:hover, .nav-grp-head:focus-visible { background: var(--brand-soft); outline: none; }
.nav-grp-head .gt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-grp-head small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.nav-grp-head.none { background: transparent; color: var(--text-2); font-weight: 700; }
.nav-grp-head .nav-tog.sm { width: 1.25rem; height: 1.25rem; font-size: .9rem; }
.nav-grp-head[aria-expanded="false"] .nav-tog { background: var(--brand); color: #fff; }
.nav-grp-edit { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 1rem; padding: 0 .2rem; border-radius: 6px; }
.nav-grp-edit:hover { background: #fff; }
.nav-grp-list { display: flex; flex-direction: column; gap: .1rem; margin: .15rem 0 .25rem .5rem; padding-left: .45rem; border-left: 2px dotted #d9b56a; }
.nav-grp-empty { margin: .2rem 0 .3rem 1rem; padding: .35rem .6rem; border: 2px dashed #d9b56a; border-radius: 8px; color: var(--muted); font-size: .8rem; }
.nav-grp.drop { background: #fff3c4; box-shadow: 0 0 0 2px #e0a400; }
.nav-sub-item.drag { cursor: grab; }
body.gp-dragging .nav-grp { box-shadow: 0 0 0 1px #e8cf94; }
.grp-h { font-size: 1rem; margin: 1rem 0 .4rem; }
.grp-list { display: flex; flex-direction: column; gap: .35rem; }
.grp-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 10px; }
.grp-row input { flex: 1; min-width: 10rem; }
.grp-row .grp-tree { flex: 1; min-width: 12rem; }
.grp-row select { min-width: 12rem; }
.nav-grp-head .gt { white-space: normal; overflow: visible; line-height: 1.2; }
.grp-dlg .btn { white-space: nowrap; }
/* 1.4.4: nút + / − thu gọn cả danh sách cây trên mục Gia phả (menu trái) */
.nav-item-wrap { position: relative; }
@media (min-width: 1100px) { .nav-item-wrap > .nav-item { padding-right: 3rem; } }
.nav-main-tog { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); width: 1.7rem; height: 1.7rem; font-size: 1.15rem; z-index: 1; }
.nav-main-tog { display: none; }
@media (min-width: 1100px) { .nav-main-tog { display: inline-flex; } }
.nav-item-wrap { display: contents; }
@media (min-width: 1100px) { .nav-item-wrap { display: block; } }
/* 1.4.5 → 1.5.1: Bản đồ gia phả theo tỉnh/TP — kiểu đỏ – vàng */
.tt-box { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold: #f4cf7a; --gp-gold2: #e6b155; --gp-cream: #fff8ec;
  --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif;
  position: relative; margin: 1.4rem 0; border-radius: 22px; overflow: hidden; color: #3a1d0b;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 120%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 120V80l40-20 30 14 50-40 40 30 30-18 50 34 40-26 50 30 40-14 30 10v40z%22 fill=%22%23e9d3a8%22 fill-opacity=%22.55%22/%3E%3Cpath d=%22M0 120V96l60-14 50 12 60-22 50 18 60-10 60 14 60-8v34z%22 fill=%22%23dcc08e%22 fill-opacity=%22.45%22/%3E%3C/svg%3E") bottom / 100% 9rem no-repeat, linear-gradient(180deg, #fff9ee, #fbefd8);
  border: 2px solid var(--gp-gold2); box-shadow: 0 0 0 3px rgba(163,20,26,.85), 0 10px 30px rgba(90,30,0,.18); }
.tt-box [hidden] { display: none !important; }
.tt-i { display: inline-flex; width: 1.15rem; height: 1.15rem; flex: none; }
.tt-i svg { width: 100%; height: 100%; display: block; }
.tt-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.4rem; padding: 1.1rem 1.25rem 1.5rem; overflow: hidden;
  background: radial-gradient(circle at 50% 100%, transparent 34%, rgba(255,214,140,.25) 35% 38%, transparent 39% 49%, rgba(255,214,140,.18) 50% 53%, transparent 54%), linear-gradient(100deg, var(--gp-dark) 0%, var(--gp-red) 40%, var(--gp-red2) 75%, #d9452a 100%); background-size: 42px 21px, auto;
  border-bottom: 3px solid var(--gp-gold2); border-radius: 0 0 50% 50% / 0 0 14px 14px; }
.tt-head-pagoda { position: absolute; right: 30%; top: -.4rem; width: 12rem; height: 6rem; color: rgba(255,214,140,.32); pointer-events: none; }
.tt-head-birds { position: absolute; right: 44%; top: .4rem; width: 3.6rem; height: 1.3rem; color: rgba(255,226,170,.6); pointer-events: none; }
.tt-title { position: relative; display: flex; align-items: center; gap: .9rem; min-width: 0; flex: 1 1 24rem; }
.tt-title-tx { min-width: 0; }
.tt-head-tree { flex: none; width: 5.2rem; height: 5rem; color: var(--gp-gold); filter: drop-shadow(0 1px 0 rgba(80,10,0,.6)); padding-right: .9rem; border-right: 1px solid rgba(255,220,150,.4); }
.tt-title h3 { margin: 0; font-family: var(--gp-serif); font-size: 1.7rem; font-weight: 700; color: #ffe7a8; text-shadow: 0 2px 0 rgba(90,10,0,.55); line-height: 1.15; }
.tt-title p { margin: .25rem 0 0; font-family: var(--gp-serif); font-style: italic; font-size: .92rem; color: #fff1d6; line-height: 1.35; }
.tt-kpis { position: relative; display: flex; gap: .55rem; flex-wrap: wrap; }
.tt-kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-width: 6.6rem; padding: .55rem .8rem .6rem; border-radius: 14px;
  background: linear-gradient(180deg, #cf3324, #9b1218); border: 2px solid var(--gp-gold2); box-shadow: inset 0 0 0 1px rgba(255,230,170,.35), 0 3px 8px rgba(60,0,0,.3); line-height: 1.15; color: #fff; }
.tt-kpi-ic { width: 1.9rem; height: 1.9rem; color: #ffe2a0; margin-bottom: .15rem; }
.tt-kpi b { font-family: var(--gp-serif); font-size: 1.6rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-kpi span { font-size: .7rem; color: #ffe9c2; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tt-kpi small { font-size: .7rem; color: #ffe2a0; }
.tt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem; margin: 1rem 1.25rem .2rem; padding: .6rem .7rem; border-radius: 999px;
  background: rgba(255,250,240,.85); border: 1.5px solid #efd59c; box-shadow: 0 2px 8px rgba(150,90,20,.08); }
.tt-seg { display: inline-flex; gap: .5rem; }
.tt-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .95rem; min-height: 2.6rem;
  background: #fdf0d2; color: #5a3410; border: 1.5px solid #efcf86; cursor: pointer; }
.tt-pill .gold { color: #b8860b; }
.tt-pill.on { background: linear-gradient(180deg, var(--gp-red2), var(--gp-red)); color: #fff4dc; border-color: var(--gp-gold2); box-shadow: 0 2px 6px rgba(163,20,26,.3); }
.tt-pill.on .tt-i { color: #ffe2a0; }
.tt-qw { flex: 1 1 14rem; min-width: 0; max-width: 24rem; display: flex; align-items: center; gap: .5rem; padding: 0 .9rem; min-height: 2.6rem; border-radius: 999px; background: #fff; border: 1.5px solid #e6cfa3; color: #8a5a2a; }
.tt-qw:focus-within { border-color: var(--gp-red); box-shadow: 0 0 0 2px rgba(163,20,26,.15); }
.tt-q { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: .92rem; font-style: italic; color: #3a1d0b; }
.tt-view { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; font-size: .9rem; color: #5a3410; font-weight: 600; }
.tt-vb { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 10px; border: 0; background: transparent; color: #8a6a4a; cursor: pointer; min-height: 0; }
.tt-vb .tt-i { width: 1.35rem; height: 1.35rem; }
.tt-vb.on { color: var(--gp-red2); background: #fdecc8; }
.tt-body { padding: .3rem 1.25rem 1rem; }
.tt-sec { margin-top: 1rem; }
.tt-sec-h { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; padding-bottom: .45rem; margin-bottom: .7rem; border-bottom: 1.5px solid #ecd3a3; }
.tt-sec-pin { width: 1.5rem; height: 1.5rem; color: var(--gp-red2); }
.tt-sec-t { font-family: var(--gp-serif); font-weight: 700; font-size: 1.25rem; color: var(--gp-red); text-transform: uppercase; letter-spacing: .02em; }
.tt-sec-c { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .5rem .3rem .9rem; border-radius: 999px; background: #fbe7b3; border: 1px solid #efcf86;
  font-weight: 700; font-size: .85rem; color: #4a2a10; white-space: nowrap; }
.tt-sec-c .tt-i { color: var(--gp-red2); }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: .7rem; }
.tt-cell { display: flex; align-items: center; gap: .75rem; min-height: 4.6rem; padding: .55rem .6rem .55rem .55rem; text-align: left; font: inherit; color: inherit;
  border-radius: 16px; border: 1.5px solid #efdcb8; background: rgba(255,252,246,.9); box-shadow: 0 2px 6px rgba(150,90,20,.07); }
.tt-thumb { flex: none; width: 4.4rem; height: 3.4rem; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1.5px #f1d28e; }
.tt-thumb svg { width: 100%; height: 100%; display: block; }
.tt-cell:not(button) .tt-thumb { filter: grayscale(.75) opacity(.55); }
.tt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-cell b { font-family: var(--gp-serif); font-weight: 700; font-size: 1.1rem; line-height: 1.2; color: #3a1d0b; }
.tt-cell .tt-old { font-size: .78rem; color: #6b5030; line-height: 1.3; margin-top: .1rem; }
.tt-cell:not(button) b { color: #8a7560; font-weight: 600; }
.tt-0 { flex: none; color: #d0b98e; font-size: 1rem; padding-right: .5rem; }
.tt-n { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.4rem; min-height: 3.2rem; padding: .25rem .4rem; border-radius: 12px;
  background: linear-gradient(180deg, var(--gp-red2), var(--gp-dark)); color: #fff; line-height: 1.05; border: 2px solid var(--gp-gold2); box-shadow: 0 2px 6px rgba(120,20,10,.3); }
.tt-n em { font-style: normal; font-family: var(--gp-serif); font-weight: 700; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.tt-n i { font-style: normal; font-size: .66rem; color: #ffe9c2; }
.tt-cell.l1 { background: linear-gradient(180deg, #fffaf0, #fdf0d6); }
.tt-cell.l2 { background: linear-gradient(180deg, #fff5e0, #fbe2b3); border-color: #ebc57c; }
.tt-cell.l3 { background: linear-gradient(180deg, #fdebc5, #f6cf86); border-color: #e0ae55; }
button.tt-cell { cursor: pointer; border-color: #ebc98a; transition: transform .12s, box-shadow .12s, border-color .12s; }
button.tt-cell:hover, button.tt-cell:focus-visible { outline: none; border-color: var(--gp-red2); box-shadow: 0 6px 16px rgba(122,30,6,.2); transform: translateY(-2px); }
.tt-body.as-list .tt-grid { grid-template-columns: 1fr; gap: .45rem; }
.tt-body.as-list .tt-cell { min-height: 3.6rem; }
.tt-body.as-list .tt-thumb { width: 3.4rem; height: 2.6rem; }
.tt-unk { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .6rem; margin-top: 1rem; padding: .7rem 1rem;
  border: 1.5px dashed #d9b878; border-radius: 14px; background: #fff5dd; color: #7a4a10; font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
.tt-unk:hover { border-style: solid; border-color: var(--gp-red2); }
.tt-unk-go { font-weight: 700; white-space: nowrap; color: var(--gp-red); }
.tt-empty { margin: 1.2rem 0 .4rem; text-align: center; color: #6b5030; font-style: italic; }
.tt-note { position: relative; z-index: 1; display: flex; align-items: center; gap: .8rem; margin: .2rem 1.25rem 0; padding: .8rem 1rem; border-radius: 16px;
  background: rgba(255,251,242,.92); border: 1.5px solid #efd59c; box-shadow: 0 2px 8px rgba(150,90,20,.08); }
.tt-note p { margin: 0; font-family: var(--gp-serif); font-style: italic; font-size: .92rem; color: #4a2a10; line-height: 1.5; }
.tt-note-ic { width: 2rem; height: 2rem; color: var(--gp-red2); }
.tt-foot { position: relative; height: 3.6rem; margin-top: -.4rem; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 60%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 30C80 6 150 44 240 26S360 8 400 22V60H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 38C80 16 160 52 250 34S370 18 400 30V60H0Z%22 fill=%22%23a3141a%22/%3E%3Cpath d=%22M0 50C90 34 170 62 260 46S370 36 400 44V60H0Z%22 fill=%22%237a0c10%22/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; pointer-events: none; }
.tt-foot-pagoda { position: absolute; right: 7rem; bottom: 1.4rem; width: 11rem; height: 5.5rem; color: rgba(200,150,80,.35); }
.tt-foot-lotus { position: absolute; right: 1rem; bottom: .7rem; width: 5.5rem; height: 3.7rem; color: #f6c35e; filter: drop-shadow(0 2px 2px rgba(120,40,0,.35)); }
.tt-box.compact { margin: 0; box-shadow: none; border: 0; border-radius: 0; }
.tt-box.compact .tt-title { display: none; }
.tt-box.compact .tt-head { padding: .8rem 1rem 1.1rem; justify-content: center; }
.tt-box.compact .tt-head-pagoda, .tt-box.compact .tt-head-birds { display: none; }
.tt-box.compact .tt-kpis { flex: 1; }
.tt-box.compact .tt-kpi { flex: 1; }
.tt-box.compact .tt-foot { display: none; }
.tt-box.compact .tt-note { margin-bottom: 1rem; }
@media (max-width: 760px) {
  .tt-head { padding: .9rem .85rem 1.2rem; }
  .tt-head-tree { width: 3.6rem; height: 3.5rem; padding-right: .6rem; }
  .tt-head-pagoda { right: 4%; width: 8rem; height: 4rem; }
  .tt-head-birds { display: none; }
  .tt-title h3 { font-size: 1.35rem; }
  .tt-title p { font-size: .8rem; }
  .tt-kpis { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tt-kpi { min-width: 0; padding: .45rem .3rem; }
  .tt-kpi-ic { width: 1.4rem; height: 1.4rem; }
  .tt-kpi b { font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tt-kpi span { font-size: .58rem; }
  .tt-bar { margin: .8rem .7rem .2rem; border-radius: 18px; padding: .55rem; }
  .tt-seg { width: 100%; } .tt-pill { flex: 1; justify-content: center; padding: .4rem .5rem; font-size: .88rem; }
  .tt-qw { max-width: none; flex-basis: 100%; }
  .tt-view { margin-left: auto; }
  .tt-body { padding: .2rem .7rem .9rem; }
  .tt-sec-t { font-size: 1rem; white-space: nowrap; }
  .tt-sec-c { font-size: .74rem; padding: .25rem .35rem .25rem .6rem; }
  .tt-grid { grid-template-columns: 1fr; gap: .5rem; }
  .tt-cell { min-height: 4rem; }
  .tt-thumb { width: 3.6rem; height: 2.8rem; }
  .tt-note { margin: .2rem .7rem 0; }
  .tt-note p { font-size: .84rem; }
  .tt-foot-pagoda { right: 4.5rem; width: 7rem; height: 3.5rem; }
  .tt-foot-lotus { width: 3.8rem; height: 2.6rem; }
}
.tt-list { display: flex; flex-direction: column; gap: .45rem; }
.tt-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tt-item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tt-item-ic { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 9px; background: var(--brand-soft); font-size: 1.1rem; }
.tt-item-tx { flex: 1; min-width: 0; }
/* 1.4.8: cửa sổ đọc nhanh Ký sự / Giỗ chạp ở Trang chủ */
.modal.pop-reader .modal-head, .modal.pop-reader .modal-foot { z-index: 3; }
.pop-read > .card:first-child, .pop-read > article:first-child { margin-top: 0; }
.pop-read .article h1 { font-size: 1.35rem; }
/* 1.4.9: cửa sổ đọc nhanh kiểu đỏ – vàng (Bản tin giỗ chạp, Ký sự dòng họ) */
.modal.gp-theme { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold: #f4cf7a; --gp-gold2: #e6b155; --gp-cream: #fff8ec;
  --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif;
  background: var(--gp-cream); border: 3px solid var(--gp-gold2); box-shadow: 0 0 0 4px rgba(163,20,26,.9), 0 20px 50px rgba(60,10,0,.45); }
.modal.gp-theme .modal-head { position: sticky; top: 0; z-index: 3; min-height: 5.6rem; padding: .8rem 1rem 1rem .9rem; gap: .7rem; overflow: hidden; border-bottom: 3px solid var(--gp-gold2);
  background: radial-gradient(circle at 50% 100%, transparent 34%, rgba(255,214,140,.28) 35% 38%, transparent 39% 49%, rgba(255,214,140,.22) 50% 53%, transparent 54% 64%, rgba(255,214,140,.16) 65% 68%, transparent 69%), linear-gradient(100deg, var(--gp-dark) 0%, var(--gp-red) 38%, var(--gp-red2) 70%, #e04a28 100%);
  background-size: 42px 21px, auto; justify-content: flex-start; }
.modal.gp-theme .modal-head h2 { flex: 1; position: relative; z-index: 1; color: #ffe7a8; font-family: var(--gp-serif); font-size: 1.95rem; font-weight: 700; letter-spacing: .01em;
  text-shadow: 0 2px 0 rgba(90,10,0,.55); padding-left: .8rem; border-left: 1px solid rgba(255,220,150,.45); line-height: 1.15; }
.gp-head-tree { position: relative; z-index: 1; flex: none; width: 4.4rem; height: 4.2rem; color: var(--gp-gold); filter: drop-shadow(0 1px 0 rgba(80,10,0,.6)); }
.gp-art { display: inline-block; line-height: 0; }
.gp-art svg { width: 100%; height: 100%; display: block; }
.gp-head-pagoda { position: absolute; right: 7.4rem; bottom: -.2rem; width: 13rem; height: 6.4rem; color: rgba(255,214,140,.42); pointer-events: none; }
.gp-head-birds { position: absolute; right: 17rem; top: .5rem; width: 4rem; height: 1.5rem; color: rgba(255,226,170,.65); pointer-events: none; }
.modal.gp-theme .modal-head .close-btn { position: relative; z-index: 2; margin-left: auto; background: var(--gp-dark); color: #fff3d6; border: 2px solid rgba(255,214,140,.55);
  border-radius: 999px; padding: .35rem 1rem; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.modal.gp-theme .modal-head .close-btn:hover { background: #5e070b; }
.modal.gp-theme .modal-body { position: relative; background: var(--gp-cream); }
.modal.gp-theme .modal-body::before { content: ""; position: absolute; right: 0; top: 0; width: 13rem; height: 7rem; pointer-events: none;
  background: radial-gradient(circle at 50% 100%, transparent 34%, rgba(214,150,70,.16) 35% 38%, transparent 39% 49%, rgba(214,150,70,.12) 50% 53%, transparent 54% 64%, rgba(214,150,70,.09) 65% 68%, transparent 69%); background-size: 46px 23px; -webkit-mask-image: linear-gradient(225deg, #000 20%, transparent 75%); mask-image: linear-gradient(225deg, #000 20%, transparent 75%); }
.modal.gp-theme .modal-foot { z-index: 3; background: linear-gradient(180deg, var(--gp-cream), #fbe8c7); border-top: 2px solid var(--gp-gold2); padding: .8rem 1rem 1rem; }
.modal.gp-theme .modal-foot .btn { min-height: 3.1rem; border-radius: 14px; font-family: var(--gp-serif); font-size: 1.05rem; font-weight: 700; gap: .55rem; }
.modal.gp-theme .modal-foot a.btn { background: #fff; color: var(--gp-red); border: 2px solid var(--gp-red); }
.modal.gp-theme .modal-foot a.btn:hover { background: #fff3ea; }
.modal.gp-theme .modal-foot button.btn { background: linear-gradient(180deg, var(--gp-red2), var(--gp-dark)); color: #fff; border: 2px solid var(--gp-gold2); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.modal.gp-theme .article { background: #fffdf8; border-color: #efd9b1; }
.modal.gp-theme .article h1 { font-family: var(--gp-serif); color: var(--gp-red); }

.gp-pop { position: relative; display: flex; flex-direction: column; gap: .85rem; color: #3a1d0b; }
.gp-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.gp-tag { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.gp-tag .ic { width: 1.15rem; height: 1.15rem; }
.gp-tag.main { background: linear-gradient(180deg, var(--gp-red2), var(--gp-red)); color: #fff4dc; box-shadow: 0 2px 6px rgba(163,20,26,.3); }
.gp-tag.soft { background: #fbe7b3; color: #6b3a0b; border: 1px solid #efcf86; }
.gp-star { color: #b8860b; font-size: 1.05rem; }
.gp-hero { display: flex; align-items: center; gap: 1.1rem; }
.gp-ava { flex: none; width: 7rem; height: 7rem; border-radius: 50%; padding: .35rem; background: radial-gradient(circle, #fff3d4 55%, #f2c96d 56% 64%, #fbe3a8 65%);
  box-shadow: 0 0 0 3px #f5d58b, 0 4px 14px rgba(150,90,20,.25); overflow: hidden; display: grid; place-items: center; }
.gp-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.gp-ava .gp-elder { width: 88%; height: 88%; border-radius: 50%; overflow: hidden; background: #fbe0a6; }
.gp-hero-tx { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; }
.gp-title { margin: 0; font-family: var(--gp-serif); font-size: 2.05rem; line-height: 1.15; color: var(--gp-red); font-weight: 700; }
.gp-cay { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .9rem .3rem .55rem; border-radius: 999px; background: #fdf0d2; border: 1.5px solid #efcf86; color: #5a3410; font-size: .92rem; }
.gp-cay b { font-weight: 700; }
.gp-cay-ic { width: 1.6rem; height: 1.5rem; color: #8a5a1a; }
.gp-pop .muc-ticks { margin-top: .1rem; }
.gp-pop .muc-tick { background: #fffaf0; border: 1.5px solid #e9d2a5; color: #4a2a10; padding: .25rem .9rem .25rem .5rem; }
.gp-pop .muc-tick .box { border-color: #8a6a3a; background: #fff; }
.gp-pop .muc-tick.on { background: #fdecc8 !important; border-color: #e0b35a !important; color: var(--gp-red) !important; font-weight: 800; }
.gp-pop .muc-tick.on .box { background: var(--gp-red2); border-color: var(--gp-red2); color: #fff; border-radius: 50%; }
.gp-when { display: grid; grid-template-columns: 1fr 1.2fr; background: #fdf1d6; border: 1.5px solid #efd59c; border-radius: 16px; padding: .85rem 1rem; }
.gp-when-c { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.gp-when-c + .gp-when-c { border-left: 1.5px solid #e2c48a; padding-left: 1.2rem; margin-left: .4rem; }
.gp-when-c small { display: block; color: #5c4330; font-size: .9rem; }
.gp-when-c b { display: block; font-family: var(--gp-serif); color: var(--gp-red); font-size: 1.3rem; line-height: 1.25; }
.gp-when-ic { flex: none; width: 2.7rem; height: 2.5rem; color: var(--gp-red2); }
.gp-sec { display: flex; align-items: center; gap: .55rem; font-family: var(--gp-serif); font-weight: 700; font-size: 1.15rem; color: #3a1d0b; margin-bottom: -.2rem; }
.gp-sec::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #d9b878, transparent); margin-left: .4rem; }
.gp-sec-ic { width: 1.5rem; height: 1.5rem; color: #b8641a; flex: none; }
.gp-sec .ic.gp-sec-ic { stroke-width: 2; }
.gp-pop .cd.big { max-width: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: 0; }
.gp-pop .cd.big .cd-u { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: .5rem;
  padding: .55rem .7rem; border-radius: 14px; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 50% 100%, transparent 34%, rgba(255,190,120,.16) 35% 38%, transparent 39% 49%, rgba(255,190,120,.12) 50% 53%, transparent 54% 64%, rgba(255,190,120,.09) 65% 68%, transparent 69%) bottom / 30px 15px repeat-x, linear-gradient(180deg, var(--gp-red2), var(--gp-dark));
  border: 2px solid var(--gp-gold2); box-shadow: 0 0 0 2px #fff1cf inset, 0 3px 8px rgba(120,20,10,.3); }
.gp-pop .cd.big .cd-u::before { content: ""; grid-row: 1 / span 2; width: 1.8rem; height: 1.8rem; background: #ffd98a; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.gp-pop .cd.big .cd-u:nth-child(1) { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%225%22 width=%2218%22 height=%2216%22 rx=%222.5%22/%3E%3Cpath d=%22M3 10h18M8 3v4M16 3v4M7 14h2M11 14h2M15 14h2M7 17.5h2M11 17.5h2%22/%3E%3C/svg%3E"); }
.gp-pop .cd.big .cd-u:nth-child(2) { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2213%22 r=%227.5%22/%3E%3Cpath d=%22M12 9v4l2.5 2M4 5l3-2.5M20 5l-3-2.5%22/%3E%3C/svg%3E"); }
.gp-pop .cd.big .cd-u:nth-child(3) { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2214%22 r=%227%22/%3E%3Cpath d=%22M12 10.5V14l2 1.5M10 3h4M12 3v4M18.5 7.5l1.5-1.5%22/%3E%3C/svg%3E"); }
.gp-pop .cd.big .cd-u:nth-child(4) { --m: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h12M6 21h12M7 3c0 5 10 6 10 9s-10 4-10 9M17 3c0 5-10 6-10 9s10 4 10 9%22/%3E%3C/svg%3E"); }
.gp-pop .cd.big .cd-u b { font-family: var(--gp-serif); font-size: 2.6rem; line-height: 1; text-align: center; text-shadow: 0 2px 0 rgba(60,0,0,.4); }
.gp-pop .cd.big .cd-u small { text-align: center; font-size: .95rem; opacity: 1; color: #fff1d6; }
.gp-pop .cd-now { grid-column: 1 / -1; font-family: var(--gp-serif); color: var(--gp-red); }
.gp-place { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; background: #fffaf1; border: 1px solid #efdcb8; border-radius: 12px; padding: .55rem .8rem; }
.gp-btns .btn { border-radius: 12px; }
.gp-pop .share-bar.big { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.gp-pop .share-bar.big .sb-btn { justify-content: center; min-height: 3.1rem; border-radius: 14px; background: #fff; border: 1.5px solid #e6cfa3; box-shadow: 0 2px 4px rgba(120,70,20,.08); font-size: 1.02rem; }
.gp-pop .share-bar.big .sb-btn:not(.zalo):not(.fb) { color: var(--gp-red); }
.gp-pop .share-bar.big .sb-btn .ic { width: 1.35rem; height: 1.35rem; }
.gp-person { position: relative; display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; padding: .8rem 1rem; border-radius: 16px; overflow: hidden;
  background: linear-gradient(90deg, #fff7e6, #fdeccb); border: 1.5px solid #efd59c; cursor: pointer; font: inherit; color: inherit; }
.gp-person:hover { border-color: var(--gp-gold2); box-shadow: 0 3px 10px rgba(150,90,20,.15); }
.gp-ini { flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; background: #f8e3b8; border: 2px solid #ecc879;
  font-family: var(--gp-serif); font-weight: 700; font-size: 1.6rem; color: var(--gp-red); object-fit: cover; }
.gp-person-tx { position: relative; z-index: 1; display: flex; flex-direction: column; }
.gp-person-tx b { font-family: var(--gp-serif); font-size: 1.3rem; color: var(--gp-red); }
.gp-person-tx small { font-size: .95rem; color: #4a3020; }
.gp-person-deco { position: absolute; right: .8rem; bottom: -.2rem; width: 6.5rem; height: 4.3rem; color: rgba(232,180,90,.38); pointer-events: none; }
.gp-block { background: #fffdf8; border: 1px solid #efdcb8; border-radius: 14px; padding: .7rem 1rem; }
.gp-block h2 { margin: 0 0 .3rem; font-family: var(--gp-serif); color: var(--gp-red); font-size: 1.15rem; }
.gp-note { display: flex; align-items: center; gap: .55rem; margin: 0; color: #4a3020; font-style: italic; font-size: .95rem; }
.gp-note .ic { flex: none; width: 1.45rem; height: 1.45rem; color: #fff; background: var(--gp-red2); border-radius: 50%; padding: .12rem; }
.gp-admin { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.gp-main { background: linear-gradient(180deg, var(--gp-red2), var(--gp-red)); color: #fff; border: 2px solid var(--gp-gold2); border-radius: 12px; font-family: var(--gp-serif); font-size: 1.05rem; padding: .5rem 1.6rem; min-height: 3rem; }
.gp-main:hover { background: linear-gradient(180deg, #d63328, var(--gp-dark)); }
@media (max-width: 760px) {
  .modal.gp-theme { box-shadow: 0 -6px 30px rgba(60,10,0,.4); border-width: 2px 0 0; }
  .modal.gp-theme .modal-head { min-height: 3.8rem; padding: .55rem .7rem .7rem .6rem; }
  .modal.gp-theme .modal-head h2 { font-size: 1.3rem; padding-left: .55rem; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .modal.gp-theme .modal-head .close-btn { flex: none; }
  .modal.gp-lotus .modal-head h2 { font-size: 1.12rem; }
  .gp-head-tree { width: 2.6rem; height: 2.5rem; }
  .gp-head-pagoda { right: 4.6rem; width: 6.5rem; height: 3.4rem; opacity: .55; }
  .modal.gp-theme .modal-head h2 { text-shadow: 0 2px 2px rgba(90,10,0,.8); }
  .gp-cay { border-radius: 14px; font-size: .85rem; }
  .modal.gp-theme .modal-foot .btn { font-size: .92rem; padding-left: .4rem; padding-right: .4rem; white-space: nowrap; gap: .35rem; }
  .modal.gp-theme .modal-foot .btn .ic { width: 1.05rem; height: 1.05rem; }
  .gp-head-birds { display: none; }
  .modal.gp-theme .modal-head .close-btn { padding: .3rem .75rem; }
  .gp-ava { width: 5rem; height: 5rem; }
  .gp-hero { gap: .8rem; align-items: flex-start; }
  .gp-title { font-size: 1.55rem; }
  .gp-when { grid-template-columns: 1fr; gap: .6rem; padding: .7rem .8rem; }
  .gp-when-c + .gp-when-c { border-left: 0; border-top: 1.5px solid #e2c48a; padding: .6rem 0 0; margin: 0; }
  .gp-when-c b { font-size: 1.15rem; }
  .gp-pop .cd.big { gap: .4rem; }
  .gp-pop .cd.big .cd-u { grid-template-columns: 1fr; padding: .45rem .2rem; }
  .gp-pop .cd.big .cd-u::before { display: none; }
  .gp-pop .cd.big .cd-u b { font-size: 1.85rem; }
  .gp-pop .cd.big .cd-u small { font-size: .8rem; }
  .gp-pop .share-bar.big { grid-template-columns: 1fr 1fr; }
  .gp-person-deco { width: 4.5rem; height: 3rem; }
}
/* 1.5.0: hộp danh sách gia phả theo tỉnh — kiểu đỏ – vàng */
.tl-list { display: flex; flex-direction: column; gap: .75rem; }
.tl-item { display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; border-radius: 18px; background: linear-gradient(180deg, #fffdf8, #fff6e6);
  border: 1.5px solid #efd59c; box-shadow: 0 2px 8px rgba(150,90,20,.08); }
.tl-ic { flex: none; width: 4.4rem; height: 4.4rem; border-radius: 50%; display: grid; place-items: center; padding: .7rem;
  background: radial-gradient(circle, #fff5d9 55%, #f7dc9a 100%); box-shadow: 0 0 0 2px #f1cf82, 0 3px 8px rgba(150,90,20,.18); }
.tl-ic svg { width: 100%; height: 100%; display: block; }
.tl-tx { flex: 1; min-width: 0; padding-left: 1rem; border-left: 1.5px solid #ecd3a3; }
.tl-name { display: block; font-family: var(--gp-serif); color: var(--gp-red); font-size: 1.45rem; line-height: 1.2; margin-bottom: .25rem; }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .4rem; color: #3f2a18; font-size: .95rem; }
.tl-m { display: inline-flex; align-items: center; gap: .35rem; }
.tl-dot { color: #a06a3a; }
.tl-meta + .tl-meta { margin-top: .2rem; }
.tl-m { min-width: 0; }
.tl-mi { display: inline-flex; width: 1.15rem; height: 1.15rem; color: var(--gp-red2); }
.tl-mi svg { width: 100%; height: 100%; }
.tl-open { flex: none; display: inline-flex; align-items: center; gap: .5rem; min-height: 3.1rem; padding: .3rem 1.2rem; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--gp-red2), var(--gp-dark)); color: #fff; border: 2px solid var(--gp-gold2);
  font-family: var(--gp-serif); font-weight: 700; font-size: 1.05rem; box-shadow: 0 3px 8px rgba(120,20,10,.25), inset 0 1px 0 rgba(255,255,255,.18); white-space: nowrap; }
.tl-open:hover, .tl-open:focus-visible { background: linear-gradient(180deg, #d63328, #5e070b); outline: none; }
.tl-open .ic { width: 1.3rem; height: 1.3rem; color: #ffe2a0; }
.modal.gp-lotus .modal-foot { position: sticky; justify-content: center; min-height: 5.6rem; padding: .9rem 1rem 1.9rem; overflow: hidden; border-top: 0; background: linear-gradient(180deg, var(--gp-cream), #fbe9c9); }
.modal.gp-lotus .modal-foot::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6rem; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 40%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 22C60 6 120 30 200 18S330 4 400 20V40H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 28C70 14 130 36 210 24S340 12 400 26V40H0Z%22 fill=%22%23a3141a%22/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.modal.gp-lotus .modal-foot button.btn { position: relative; z-index: 1; flex: 0 1 26rem; background: #fffaf0; color: var(--gp-red); border: 2px solid var(--gp-red);
  box-shadow: 0 3px 10px rgba(120,20,10,.18); font-size: 1.15rem; }
.modal.gp-lotus .modal-foot button.btn:hover { background: #fff0e0; }
.gp-x { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid currentColor; }
.gp-x .ic { width: 1rem; height: 1rem; }
.gp-foot-lotus { position: absolute; bottom: .3rem; width: 5.5rem; height: 3.7rem; color: #f2a08c; opacity: .75; pointer-events: none; }
.gp-foot-lotus.l { left: .6rem; } .gp-foot-lotus.r { right: .6rem; transform: scaleX(-1); }
@media (max-width: 760px) {
  .tl-item { flex-wrap: wrap; gap: .7rem; padding: .75rem .8rem; }
  .tl-ic { width: 3.4rem; height: 3.4rem; padding: .5rem; }
  .tl-tx { padding-left: .7rem; }
  .tl-name { font-size: 1.2rem; }
  .tl-meta { font-size: .88rem; }
  .tl-open { width: 100%; justify-content: center; min-height: 2.8rem; }
  .gp-foot-lotus { width: 3.8rem; height: 2.6rem; }
  .modal.gp-lotus .modal-foot button.btn { flex: 0 1 15rem; }
}

/* 1.5.2: Trang chủ kiểu đỏ – vàng (khối đầu, lễ gần nhất, ô lối vào, Lịch giỗ chạp) */
.view:has(> .hm-hero) { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold2: #e6b155; --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif; }
.hm-hero, .hm-sec, .hm-tiles { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold2: #e6b155; --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif; }
.hm-i { display: inline-flex; width: 1.1rem; height: 1.1rem; flex: none; }
.hm-i svg { width: 100%; height: 100%; display: block; }
.hm-i.red { color: var(--gp-red2); }
.hm-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 1.1rem 1.2rem 1.2rem; margin-bottom: 1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 120%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 120V70l50-24 30 12 60-40 50 34 40-18 60 30 50-26 60 34v48z%22 fill=%22%23ead2a2%22 fill-opacity=%22.55%22/%3E%3Cpath d=%22M0 120V92l70-16 60 14 70-24 60 20 70-12 70 12v34z%22 fill=%22%23d9bb86%22 fill-opacity=%22.5%22/%3E%3C/svg%3E") right bottom / 70% 8rem no-repeat, radial-gradient(120% 90% at 85% 0%, #fde9c2 0%, transparent 60%), linear-gradient(180deg, #fff8ea, #fbecd2);
  border: 1.5px solid #efd59c; box-shadow: 0 4px 18px rgba(150,90,20,.12); }
.hm-scene { position: absolute; inset: 0; pointer-events: none; }
.hm-pagoda { position: absolute; right: 6%; top: .2rem; width: 17rem; height: 8.5rem; color: rgba(176,90,40,.28); }
.hm-birds { position: absolute; right: 30%; top: .8rem; width: 4.5rem; height: 1.6rem; color: rgba(120,60,20,.5); }
.hm-lotus { position: absolute; color: #f2a3ad; filter: drop-shadow(0 2px 2px rgba(160,60,60,.25)); }
.hm-lotus.a { right: 1rem; bottom: .6rem; width: 6rem; height: 4rem; }
.hm-lotus.b { right: 7.2rem; bottom: .3rem; width: 4.2rem; height: 2.8rem; opacity: .85; }
.hm-hero .welcome { position: relative; align-items: flex-end; margin-bottom: .9rem; }
.hm-who { min-width: 0; }
.hm-hero .loc-title { font-family: var(--gp-serif); color: var(--gp-red); font-size: 2rem; font-weight: 700; line-height: 1.15; gap: .45rem; }
.hm-hero .loc-pin { width: 1.7rem; height: 1.7rem; color: var(--gp-red2); }
.hm-date { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; color: #3a1d0b; font-size: 1rem; }
.hm-date-ic { width: 1.3rem; height: 1.3rem; color: #4a2a10; }
.hm-hero .loc-src { margin-top: .35rem; color: #3a1d0b; font-size: .92rem; gap: .5rem; }
.hm-src-ic { width: 1.3rem; height: 1.3rem; color: #6b3a10; }
.hm-sep { color: #c8a46a; }
.hm-hero .loc-src .linkbtn { color: var(--gp-red2); text-decoration: underline; font-weight: 600; }
.hm-chips { position: relative; display: flex; flex-wrap: wrap; gap: .45rem; align-self: flex-end; margin-left: auto; }
.hm-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 999px; background: rgba(255,247,226,.95); border: 1.5px solid #efcf86;
  color: #3a1d0b; font-weight: 700; font-size: .88rem; text-decoration: none; box-shadow: 0 2px 6px rgba(150,90,20,.12); }
a.hm-chip:hover { border-color: var(--gp-red2); }
.hm-chip .hm-i { width: 1.2rem; height: 1.2rem; }
.hm-hero .next-ev { position: relative; max-width: 46rem; padding: 2.4rem 1.2rem 1rem; border: 1.5px solid #efd59c; border-radius: 18px;
  background: rgba(255,251,242,.92); box-shadow: 0 3px 12px rgba(150,90,20,.12); }
.hm-hero .next-ev:hover { border-color: var(--gp-gold2); }
.hm-tab { position: absolute; left: -1px; top: -1px; display: inline-flex; align-items: center; gap: .55rem; padding: .35rem 2.4rem .35rem 1rem; margin: 0;
  color: #fff3d6; font-weight: 700; font-size: .92rem; border-radius: 18px 0 0 0;
  background: linear-gradient(90deg, var(--gp-dark), var(--gp-red2)); clip-path: polygon(0 0, 100% 0, calc(100% - 1.6rem) 100%, 0 100%); }
.hm-tab-lotus { width: 2rem; height: 1.35rem; color: #f6c35e; }
.hm-ev-name { margin: .25rem 0 .3rem; font-family: var(--gp-serif); color: var(--gp-red); font-size: 1.45rem; line-height: 1.25; }
.hm-ev-when { display: flex; align-items: center; gap: .45rem; color: #3a1d0b; }
.hm-ev-when .hm-i { width: 1.25rem; height: 1.25rem; }
.hm-hero .next-ev .cd { margin-top: .6rem; gap: .6rem; }
.hm-hero .next-ev .cd-u { min-width: 4.4rem; padding: .4rem .5rem; border-radius: 12px; background: linear-gradient(180deg, var(--gp-red2), var(--gp-dark)); border: 2px solid var(--gp-gold2);
  box-shadow: inset 0 0 0 1px rgba(255,230,170,.35), 0 3px 8px rgba(120,20,10,.25); }
.hm-hero .next-ev .cd-u b { font-family: var(--gp-serif); font-size: 1.8rem; }
.hm-hero .next-ev .cd-u small { color: #ffe9c2; }
.hm-hero .next-ev .cd-u:nth-child(4) { display: none; }
.hm-tiles { margin-top: 0; }
.hm-tiles .tile { position: relative; min-height: 6.6rem; border-radius: 16px; border: 1.5px solid #efd59c; background: linear-gradient(180deg, #fffbf2, #fdf0d8); box-shadow: 0 3px 10px rgba(150,90,20,.1); }
.hm-tiles .tile:hover { border-color: var(--gp-red2); transform: translateY(-1px); }
.hm-tiles .tile .ic { color: var(--gp-red2); width: 2.3rem; height: 2.3rem; }
.hm-tiles .tile b { font-family: var(--gp-serif); color: #3a1d0b; padding-right: 1.8rem; }
.hm-tiles .tile .hm-tile-go { position: absolute; right: .8rem; top: 1rem; }
.hm-tile-go { width: 1.6rem; height: 1.6rem; padding: .3rem; border-radius: 50%; background: #fbe3b0; color: var(--gp-red2); }
.hm-sec { position: relative; margin-top: 1.4rem; padding: 2.8rem .9rem 0; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #fffaf0, #fbedd3); border: 1.5px solid #efd59c; box-shadow: 0 4px 16px rgba(150,90,20,.1); }
.hm-sec-h { display: flex; align-items: center; justify-content: flex-end; }
.hm-tab.big { font-family: var(--gp-serif); font-size: 1.45rem; padding: .5rem 3rem .5rem 1.1rem; border-radius: 22px 0 0 0; }
.hm-tab.big .hm-tab-lotus { width: 2.6rem; height: 1.75rem; }
.hm-all { position: absolute; right: 1.2rem; top: .8rem; font-family: var(--gp-serif); font-weight: 700; color: var(--gp-red2); text-decoration: underline; font-size: 1.05rem; }
.hm-list { position: relative; z-index: 1; margin-left: 0; background: rgba(255,252,246,.95); border: 1.5px solid #efd59c; border-radius: 16px; padding: .2rem .8rem; }
.hm-row { text-decoration: none; color: inherit; border-bottom: 1px solid #efe0c2; padding: .7rem .2rem; }
.hm-row:last-child { border-bottom: 0; }
.hm-row:hover { background: #fff4de; }
.hm-row-ic { flex: none; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: radial-gradient(circle, #fff1cf 50%, #f6d796 100%); color: #8a2a10; box-shadow: 0 2px 5px rgba(150,90,20,.2); }
.hm-row-ic .hm-i { width: 1.4rem; height: 1.4rem; }
.hm-row-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-row-tx b { font-family: var(--gp-serif); font-size: 1.12rem; color: #6b1a10; }
.hm-row.le .hm-row-tx b { color: var(--gp-red2); }
.hm-row-tx small { color: #3a1d0b; font-size: .9rem; }
.hm-days { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .5rem .3rem .9rem; border-radius: 999px; background: #fbe3b0; color: #4a2a10; font-weight: 700; white-space: nowrap; }
.hm-days .hm-i { width: 1rem; height: 1rem; color: var(--gp-red2); }
.hm-days.soon { background: linear-gradient(180deg, #fde3a8, #f6c35e); }
.hm-sec-foot { position: relative; height: 3.4rem; margin: -.6rem -.9rem 0; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 60%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 30C80 6 150 44 240 26S360 8 400 22V60H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 38C80 16 160 52 250 34S370 18 400 30V60H0Z%22 fill=%22%23a3141a%22/%3E%3Cpath d=%22M0 50C90 34 170 62 260 46S370 36 400 44V60H0Z%22 fill=%22%237a0c10%22/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.hm-foot-lotus { position: absolute; left: .8rem; bottom: 1.4rem; width: 5rem; height: 3.3rem; color: #f2a3ad; z-index: 2; }
@media (max-width: 760px) {
  .hm-hero { padding: .9rem .8rem 1rem; background-size: 100% 6rem, auto, auto; }
  .hm-pagoda { right: -1rem; width: 10rem; height: 5rem; opacity: .7; }
  .hm-birds { display: none; }
  .hm-lotus.a { width: 3.8rem; height: 2.6rem; } .hm-lotus.b { display: none; }
  .hm-hero .loc-title { font-size: 1.45rem; }
  .hm-date { font-size: .9rem; align-items: flex-start; }
  .hm-chips { margin-top: .3rem; }
  .hm-chip { font-size: .8rem; padding: .3rem .65rem; }
  .hm-hero .next-ev { padding: 0 .85rem .9rem; }
  .hm-hero .next-ev .hm-tab { position: relative; left: auto; top: auto; display: flex; margin: -1px -.85rem .5rem; border-radius: 18px 18px 0 0; clip-path: none; padding: .45rem .9rem; }
  .hm-tab { font-size: .8rem; padding-right: 2rem; }
  .hm-ev-name { font-size: 1.2rem; }
  .hm-hero .next-ev .cd-u { min-width: 3.6rem; }
  .hm-hero .next-ev .cd-u b { font-size: 1.5rem; }
  .hm-sec { padding: 2.6rem .6rem 0; }
  .hm-tab.big { font-size: 1.15rem; padding-right: 2.2rem; }
  .hm-all { top: .65rem; right: .8rem; font-size: .9rem; }
  .hm-list { margin-left: 0; padding: .1rem .5rem; }
  .hm-row-ic { display: none; }
  .hm-row { gap: .5rem; }
  .hm-days .hm-i { display: none; }
  .hm-row-tx b { font-size: 1rem; }
  .hm-row-tx small { font-size: .82rem; }
  .hm-days { font-size: .8rem; padding: .25rem .6rem; }
  .hm-foot-lotus { display: none; }
  .hm-sec-foot { margin: -.6rem -.6rem 0; height: 2.6rem; }
}
/* 1.5.3: Menu trái kiểu đỏ – vàng (băng Trang chủ, mục Ký sự / Gia phả, nhãn tỉnh, thẻ có ›, chân hoa sen) */
.nav.gnav { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold2: #e6b155;
  background: linear-gradient(180deg, #fffaf1, #fdf3e2); border-right: 1px solid #efd9ab; overflow-y: auto; }
.gn-i { display: inline-flex; width: 1.1rem; height: 1.1rem; flex: none; }
.gn-i svg { width: 100%; height: 100%; display: block; }
.gnav .nav-item { color: #3a1d0b; }
.gnav .nav-item .gn-i.ic { color: var(--gp-red); }
.gnav .nav-item.active { background: #fbe6c2; color: var(--gp-dark); }
.gnav-head { display: contents; }
.gnav-head .gp-art, .gnav-foot, .gnav-sep, .gnav .gn-go { display: none; }
@media (min-width: 1100px) {
  .nav.gnav { gap: .15rem; padding: 0 .55rem 0; }
  /* băng Trang chủ */
  .gnav-head { display: block; position: relative; flex: none; margin: 0 -.55rem .35rem; height: 4.6rem; overflow: hidden;
    background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 40%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 24C90 4 170 40 260 22S370 6 400 16V40H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 30C90 12 170 46 262 28S372 14 400 24V40H0Z%22 fill=%22%23fffaf1%22/%3E%3C/svg%3E") bottom / 100% 1.6rem no-repeat,
      radial-gradient(120% 140% at 85% 10%, #e9a24a 0, rgba(233,162,74,0) 45%), linear-gradient(100deg, var(--gp-dark), var(--gp-red) 45%, #b8371c); }
  .gnav-head .gp-art { display: block; position: absolute; pointer-events: none; }
  .gnav-head .gnav-tree { right: 3.8rem; top: .15rem; width: 3.6rem; height: 3.5rem; color: #f1c15e; opacity: .9; }
  .gnav-head .gnav-pagoda { right: -.4rem; top: .9rem; width: 5.6rem; height: 2.8rem; color: #ffe2a6; opacity: .75; }
  .gnav .nav-item.nv-home { position: relative; z-index: 1; min-height: 3.4rem; padding: 0 1rem 0 .7rem; gap: .65rem; color: #fff; font-size: 1.12rem; font-weight: 800; background: none; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
  .gnav .nav-item.nv-home .gn-i.ic { width: 2.5rem; height: 2.5rem; padding: .45rem; border-radius: 50%; color: #fff3d6; background: rgba(122,12,16,.65); box-shadow: inset 0 0 0 1.5px rgba(246,195,94,.55); }
  .gnav-head.on .nav-item.nv-home .gn-i.ic { background: #f6c35e; color: var(--gp-dark); }
  /* mục đầu: Ký sự, Gia phả */
  .gnav .nav-item.gsect:not(.nv-home) { font-weight: 800; font-size: 1.02rem; padding: 0 .6rem; gap: .75rem; }
  .gnav .nav-item.gsect:not(.nv-home) .gn-i.ic { width: 1.55rem; height: 1.55rem; }
  .gnav .nav-item.gsect.active:not(.nv-home) { background: #fbe6c2; }
  .gnav .nav-main-tog { width: 1.75rem; height: 1.75rem; border: 2px solid var(--gp-gold2); background: #fffaf1; color: var(--gp-red); font-weight: 800; }
  .gnav .nav-main-tog[aria-expanded="false"] { background: var(--gp-red); border-color: var(--gp-red); color: #fff; }
  .gnav .nav-sub { margin: -.1rem 0 .35rem .75rem; padding-left: .45rem; border-left: 1.5px solid #ecd3a0; gap: .15rem; }
  .gnav .nav-sub-item { color: #3a1d0b; font-weight: 600; }
  .gnav .nav-sub-item .em { display: inline-flex; width: 1.25rem; height: 1.25rem; font-size: 0; }
  .gnav .nav-sub-item:hover { background: #fbecd0; }
  .gnav .nav-sub-item.on { background: #fbe6c2; color: var(--gp-dark); }
  .gnav .nav-sub-item .dot { background: var(--gp-red); }
  .gnav .nav-sub-item small { color: #5a3a1a; font-weight: 600; }
  .gnav .nav-tog { border-color: var(--gp-red); color: var(--gp-red); }
  .gnav .nav-tog[aria-expanded="false"] { background: var(--gp-red); color: #fff; }
  /* nhãn nhóm (tỉnh) */
  .gnav .nav-grp { margin: .12rem 0; }
  .gnav .nav-grp-head { gap: .4rem; min-height: 2.6rem; padding: .3rem .55rem .3rem .45rem; border-radius: 12px; color: var(--gp-red); font-size: 1rem;
    background: linear-gradient(180deg, #fdf0d8, #f9e3bd); box-shadow: 0 1px 3px rgba(150,90,20,.15), inset 0 0 0 1px #f0d49c; }
  .gnav .nav-grp-head.none { color: var(--gp-red); font-weight: 800; background: linear-gradient(180deg, #fdf3e2, #f7e6c8); }
  .gnav .nav-grp-head:hover, .gnav .nav-grp-head:focus-visible { box-shadow: 0 1px 3px rgba(150,90,20,.15), inset 0 0 0 1.5px var(--gp-gold2); }
  .gnav .nav-grp-head .gt { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gnav .nav-grp-head small { flex: none; white-space: nowrap; }
  .gnav .nav-grp-edit { display: none; flex: none; }
  .gnav .nav-grp-head:hover .nav-grp-edit, .gnav .nav-grp-head:focus-within .nav-grp-edit { display: inline-block; }
  .gnav .nav-grp-head .nav-tog.sm { width: 1.4rem; height: 1.4rem; font-size: 1.05rem; background: var(--gp-red); border-color: var(--gp-red); color: #fff; }
  .gnav .gn-bush { width: 1.35rem; height: 1.35rem; }
  .gnav .nav-grp-head small { color: #3a1d0b; font-size: .8rem; }
  .gnav .gn-go { display: inline-flex; width: 1rem; height: 1rem; color: var(--gp-red); margin-left: auto; }
  .gnav .nav-grp-head small + .gn-go, .gnav .nav-grp-edit + .gn-go { margin-left: 0; }
  .gnav .nav-grp-list { margin: .15rem 0 .25rem .7rem; padding-left: .45rem; border-left: 1.5px dashed #e3bf7a; }
  .gnav .nav-grp-empty { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 .35rem .9rem; padding: .4rem .7rem; border: 1.5px dashed #e6b155; border-radius: 12px; background: #fffaf0; color: #3a1d0b; font-size: .85rem; }
  .gnav .nav-grp-empty .gn-i { width: 1.15rem; height: 1.15rem; }
  /* lối vào: theo tỉnh / nhãn / tạo cây */
  .gnav .nav-sub-item.add { margin-top: .15rem; min-height: 2.5rem; padding: .3rem .6rem; border-radius: 12px; background: #fffaf2; color: #3a1d0b; box-shadow: 0 1px 3px rgba(150,90,20,.14), inset 0 0 0 1px #f0dcb4; }
  .gnav .nav-sub-item.add .em { color: var(--gp-red); }
  .gnav .nav-sub-item.add.tinh { background: linear-gradient(180deg, #fbe2b4, #f6d199); color: var(--gp-red); font-weight: 800; }
  .gnav .nav-sub-item.add:hover { box-shadow: 0 1px 3px rgba(150,90,20,.14), inset 0 0 0 1.5px var(--gp-gold2); }
  .gnav-sep { display: block; flex: none; height: 1px; margin: .4rem .3rem .45rem; background: linear-gradient(90deg, transparent, #e6c588, transparent); }
  /* mục dạng thẻ có › */
  .gnav .nav-item.gcard { min-height: 2.9rem; margin: .1rem 0; padding: 0 .75rem; border-radius: 12px; font-weight: 800; background: #fffaf2;
    box-shadow: 0 1px 3px rgba(150,90,20,.14), inset 0 0 0 1px #f0dcb4; }
  .gnav .nav-item.gcard:hover { box-shadow: 0 1px 3px rgba(150,90,20,.14), inset 0 0 0 1.5px var(--gp-gold2); }
  .gnav .nav-item.gcard.active { background: #fbe6c2; box-shadow: inset 0 0 0 1.5px var(--gp-gold2); }
  .gnav .nav-item.gcard .gn-i.ic { width: 1.45rem; height: 1.45rem; }
  .gnav .nav-item.gcard .badge { margin-left: auto; }
  .gnav .nav-item.gcard .badge + .gn-go { margin-left: .2rem; }
  /* chân: sóng + hoa sen */
  .gnav-foot { display: block; position: relative; flex: none; margin: auto -.55rem 0; min-height: 4.4rem; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 60%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 30C80 6 150 44 240 26S360 8 400 22V60H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 38C80 16 160 52 250 34S370 18 400 30V60H0Z%22 fill=%22%23a3141a%22/%3E%3Cpath d=%22M0 50C90 34 170 62 260 46S370 36 400 44V60H0Z%22 fill=%22%237a0c10%22/%3E%3C/svg%3E") bottom / 100% 2.6rem no-repeat; }
  .gnav-foot .gp-art { position: absolute; color: #f2a3ad; filter: drop-shadow(0 2px 2px rgba(160,60,60,.3)); }
  .gnav-lotus.a { right: .6rem; bottom: 1rem; width: 4.6rem; height: 3.1rem; }
  .gnav-lotus.b { right: 4.4rem; bottom: .9rem; width: 3rem; height: 2rem; opacity: .85; color: #f6c9a0; }
}
/* 1.5.4: Trang chủ — Ký sự dòng họ (đỏ – vàng) và Địa danh Mai tộc (xanh lá) */
.hm-duo { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold2: #e6b155; --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif;
  position: relative; margin-top: 1.4rem; padding: .9rem .9rem 0; border-radius: 22px; overflow: hidden; border: 1.5px solid #efd59c;
  background: linear-gradient(180deg, #fff6e6, #fdf0da 60%, #fbf2df); box-shadow: 0 4px 18px rgba(150,90,20,.12); }
.hm-blk { --bk1: var(--gp-dark); --bk2: var(--gp-red2); --bkt: var(--gp-red); --bkg: #a3141a; position: relative; padding-bottom: 1.2rem; }
.hm-blk.place { --bk1: #1d4a12; --bk2: #3b7d24; --bkt: #2f6b1f; --bkg: #2a6a1c; margin-top: .6rem;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 80%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 80V44l40-14 36 10 50-26 44 22 40-12 50 20 46-18 50 16 44-10v48z%22 fill=%22%23cfe0a8%22 fill-opacity=%22.55%22/%3E%3Cpath d=%22M0 80V58l60-12 50 10 60-16 54 14 60-8 60 12 56-6v28z%22 fill=%22%23b7d18a%22 fill-opacity=%22.45%22/%3E%3C/svg%3E") top / 100% 6.5rem no-repeat; }
.hm-blk-scene { position: absolute; inset: 0 0 auto auto; width: 60%; height: 6rem; pointer-events: none; }
.hm-blk-scene .gp-art { position: absolute; }
.hm-blk-pagoda { right: 9rem; top: -.4rem; width: 11rem; height: 5.4rem; color: rgba(176,90,40,.32); }
.hm-blk-tree { right: 20rem; top: -.2rem; width: 4.5rem; height: 4.4rem; color: rgba(84,120,40,.35); }
.hm-blk-birds { right: 31rem; top: .4rem; width: 4rem; height: 1.4rem; color: rgba(120,60,20,.5); }
.hm-blk.place .hm-blk-scene { display: none; }
.hm-blk-h { position: relative; display: flex; align-items: flex-end; min-height: 3.6rem; margin: 0 0 .8rem; border-bottom: 2px solid #e8c47a; }
.hm-blk-tab { display: inline-flex; align-items: center; gap: .7rem; margin: 0; padding: .55rem 3.4rem .55rem 1.1rem; color: #fff; font-size: 1.5rem; font-weight: 800; line-height: 1.2;
  border-radius: 18px 0 0 0; background: linear-gradient(90deg, var(--bk1), var(--bk2)); clip-path: polygon(0 0, calc(100% - 2rem) 0, 100% 100%, 0 100%);
  text-shadow: 0 1px 2px rgba(0,0,0,.25); box-shadow: inset 0 -3px 0 rgba(246,195,94,.55); }
.hm-blk-ic { width: 2.2rem; height: 2.2rem; color: #fff; }
.hm-cloud { display: inline-flex; width: 5.4rem; height: 2.3rem; margin: 0 0 -.2rem -1.6rem; }
.hm-cloud svg { width: 100%; height: 100%; }
.hm-blk-all { position: absolute; right: 0; top: .2rem; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1.1rem; border-radius: 999px;
  background: linear-gradient(180deg, #fff9e8, #fbe7b9); border: 1.5px solid #ecc874; color: var(--bkt); font-weight: 800; text-decoration: none; box-shadow: 0 2px 6px rgba(150,90,20,.15); }
.hm-blk-all:hover { border-color: var(--bk2); }
.hm-blk-all .hm-i { width: 1.1rem; height: 1.1rem; }
.hm-cards { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.hmc { display: flex; flex-direction: column; padding: .45rem; border-radius: 16px; background: #fffaf0; border: 1.5px solid #f0d8a8; color: #3a1d0b; text-decoration: none;
  box-shadow: 0 3px 10px rgba(150,90,20,.12); min-width: 0; }
a.hmc:hover, .hmc:hover { border-color: var(--gp-gold2); }
.hmc-pic { position: relative; display: block; width: 100%; height: 11.5rem; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #f4e6c8; cursor: pointer; }
.hmc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hmc-ph { display: grid; place-items: center; width: 100%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 300 120%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 120V70l40-22 30 14 50-36 46 32 34-20 50 30 50-22v74z%22 fill=%22%23e2cfa6%22 fill-opacity=%22.6%22/%3E%3Cpath d=%22M0 120V92l70-18 50 14 60-24 54 18 66-12v50z%22 fill=%22%23d3b98a%22 fill-opacity=%22.55%22/%3E%3C/svg%3E") bottom / 100% 75% no-repeat, linear-gradient(180deg, #fbf3e2, #f2e3c4); }
.hmc-ph-ic { width: 4.2rem; height: 4.2rem; color: #9c4a17; filter: drop-shadow(0 3px 4px rgba(120,60,20,.25)); }
.hmc-badge { position: absolute; left: .6rem; top: .6rem; display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .75rem; border-radius: 999px;
  background: linear-gradient(90deg, var(--gp-dark), var(--gp-red2)); color: #fff; font-weight: 800; font-size: .88rem; box-shadow: 0 0 0 2px rgba(246,195,94,.7); }
.hmc-badge .hm-i { width: 1rem; height: 1rem; color: #fff; }
.hmc-zoom { position: absolute; right: .55rem; top: .55rem; display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px;
  background: rgba(40,30,20,.6); color: #fff; font-weight: 700; font-size: .85rem; }
.hmc-zoom .hm-i { width: 1rem; height: 1rem; }
.hmc-chip { position: absolute; left: .55rem; bottom: .55rem; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .75rem; border-radius: 999px;
  background: #fff6dc; border: 1.5px solid #ecc874; color: #3a1d0b; font-weight: 700; font-size: .85rem; }
.hmc-chip .hm-i { width: 1rem; height: 1rem; color: var(--gp-red2); }
.hmc-in { display: flex; flex-direction: column; gap: .3rem; flex: 1; padding: .7rem .45rem .35rem; color: inherit; text-decoration: none; min-width: 0; }
.hmc-t { color: var(--gp-red); font-size: 1.12rem; font-weight: 800; line-height: 1.3; }
.hmc-meta { display: flex; align-items: flex-start; gap: .45rem; font-size: .9rem; color: #4a3220; }
.hmc-meta .hm-i { width: 1.05rem; height: 1.05rem; margin-top: .1rem; color: #5a3a1a; }
.hmc-meta .hm-i.red { color: var(--gp-red2); }
.hmc-sum { font-size: .88rem; color: #6a5440; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hmc-more { align-self: flex-end; display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; padding: .35rem .95rem; border-radius: 999px;
  background: linear-gradient(180deg, #fff3d4, #f8dca0); border: 1.5px solid #ecc874; color: var(--gp-red); font-weight: 800; font-size: .9rem; }
.hmc-more .hm-i { width: 1rem; height: 1rem; }
a.hmc:hover .hmc-more { border-color: var(--gp-red2); }
.hmc-act { display: flex; flex-wrap: wrap; gap: .4rem; padding: .3rem .25rem; }
.hmc-btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; flex: 1 1 auto; min-height: 2.6rem; padding: .3rem .55rem; border-radius: 12px;
  background: #fffaf0; border: 1.5px solid #e6c588; color: #3a1d0b; font-weight: 700; font-size: .82rem; text-decoration: none; white-space: nowrap; }
.hmc-btn .hm-i { width: 1.05rem; height: 1.05rem; color: #8a5a24; }
.hmc-btn:hover { border-color: var(--bk2); }
.hmc-btn.go { background: linear-gradient(180deg, var(--bk2), var(--bk1)); border-color: var(--bk1); color: #fff; font-weight: 800; font-size: .95rem; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.hmc-btn.go .hm-i { color: #fff; }
.hm-duo-foot { position: relative; height: 4.2rem; margin: -.4rem -.9rem 0;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 60%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 26C60 8 110 30 170 20S260 2 330 18 390 22 400 16V60H0Z%22 fill=%22%23c9dc9a%22 fill-opacity=%22.6%22/%3E%3Cpath d=%22M0 34C80 10 150 48 240 30S360 12 400 26V60H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 42C80 20 160 56 250 38S370 22 400 34V60H0Z%22 fill=%22%23a3141a%22/%3E%3Cpath d=%22M0 52C90 38 170 64 260 50S370 40 400 48V60H0Z%22 fill=%22%237a0c10%22/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.hm-duo-lotus { position: absolute; bottom: 1.2rem; width: 5rem; height: 3.4rem; color: #f2a3ad; filter: drop-shadow(0 2px 2px rgba(160,60,60,.3)); z-index: 2; }
.hm-duo-lotus.a { left: .8rem; }
.hm-duo-lotus.b { right: .8rem; width: 4rem; height: 2.7rem; }
@media (max-width: 899px) { .hm-blk-scene { width: 100%; } .hm-blk-pagoda { right: 8rem; } .hm-blk-tree, .hm-blk-birds { display: none; } }
@media (max-width: 599px) {
  .hm-duo { padding: .7rem .6rem 0; }
  .hm-blk-h { min-height: 0; flex-wrap: wrap; padding-top: 2.6rem; }
  .hm-blk-tab { font-size: 1.15rem; padding: .45rem 2.6rem .45rem .8rem; }
  .hm-blk-ic { width: 1.7rem; height: 1.7rem; }
  .hm-cloud { width: 4rem; height: 1.8rem; }
  .hm-blk-all { top: 0; padding: .35rem .85rem; font-size: .9rem; }
  .hm-blk-pagoda { right: 7rem; width: 8rem; height: 4rem; }
  .hm-cards { grid-template-columns: 1fr; }
  .hmc-pic { height: 10rem; }
  .hmc-btn { font-size: .82rem; padding: .3rem .45rem; }
  .hm-duo-foot { margin: -.4rem -.6rem 0; height: 3rem; }
  .hm-duo-lotus.b { display: none; }
}
/* 1.5.5: dòng giỗ ở Trang chủ ghi nhánh gia phả */
.hm-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .55rem; min-width: 0; }
.hm-row-cay { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; padding: .1rem .6rem .1rem .4rem; border-radius: 999px;
  background: #f1f7e6; border: 1px solid #cfe0a8; color: #2f5a1c; font-size: .8rem; font-weight: 700; line-height: 1.3; }
.hm-row-cay span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-row-cay .hm-i { width: .95rem; height: .95rem; }
@media (max-width: 599px) { .hm-row-cay { font-size: .72rem; } }
/* 1.5.6: lượt xem */
.views { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; color: #6a5440; font-size: inherit; vertical-align: middle; }
.views .ic { width: 1.05em; height: 1.05em; opacity: .85; }
.views.sm { font-size: .95em; }
.hmc-meta .views { font-size: .9rem; }
.gp-views { margin-top: .35rem; color: #6b3a10; font-size: .92rem; }
/* 1.5.7: Ký sự dòng họ / Địa danh Mai tộc — đúng theo hình mẫu (ảnh nền cắt từ mẫu: assets/img/hm/) */
.hm-duo { padding: .9rem .9rem 0; border: 0; border-radius: 22px; background: #fef6df; box-shadow: 0 4px 18px rgba(150,90,20,.10); }
.hm-blk { padding-bottom: 1.1rem; background: none; }
.hm-blk.place { background: none; margin-top: .4rem; }
.hm-blk-scene { display: none; }
.hm-blk::before { content: ""; position: absolute; top: -.9rem; right: -.9rem; width: min(100% + .9rem, 47rem); height: 5.6rem; pointer-events: none;
  background: url("../img/hm/canh-dinh.jpg") right top / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%); mask-image: linear-gradient(90deg, transparent 0, #000 18%); }
.hm-blk.place::before { top: -.2rem; width: min(100% + .9rem, 52rem); height: 4.6rem; background-image: url("../img/hm/doi-xanh.jpg"); }
.hm-blk > * { position: relative; }
.hm-blk-h { min-height: 3.9rem; margin: 0 0 .7rem; border-bottom: 0; align-items: flex-end; }
.hm-blk-h::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #e9b54e, #f6d98b 40%, rgba(246,217,139,0) 85%); }
.hm-blk.place .hm-blk-h::after { background: linear-gradient(90deg, #e9b54e, #e9e3a0 40%, rgba(220,232,160,0) 85%); }
.hm-blk-tab { gap: .75rem; padding: .55rem 2.6rem .5rem 1.1rem; font-size: 1.55rem; clip-path: none; border-radius: 18px 46px 0 0 / 18px 60px 0 0;
  background: linear-gradient(90deg, #8e0d12, #c41d1d 55%, #d8322a); box-shadow: inset 0 -4px 0 #f0c25c, 0 2px 6px rgba(120,20,10,.25); }
.hm-blk.place .hm-blk-tab { background: linear-gradient(90deg, #1c4510, #2f6b1f 55%, #3f8a28); }
.hm-blk-ic { width: 2.4rem; height: 2.4rem; }
.hm-cloud { width: 6.6rem; height: 2.8rem; margin: 0 0 -.15rem -2.2rem; z-index: 2; filter: drop-shadow(0 2px 2px rgba(150,90,20,.25)); }
.hm-blk-all { top: .35rem; padding: .55rem 1.25rem; font-size: 1.05rem; border: 1.5px solid #f0cf7c; color: #7a1410;
  background: linear-gradient(180deg, #fffbe9, #fbe8b4); box-shadow: 0 3px 8px rgba(150,90,20,.2), inset 0 1px 0 #fff; }
.hm-blk.place .hm-blk-all { color: #1f4d12; border-color: #cddf8f; background: linear-gradient(180deg, #fbfde9, #e6f0bd); }
.hm-cards { gap: .9rem; }
.hmc { padding: .4rem; border-radius: 16px; background: linear-gradient(180deg, #fffaf0, #fff4de); border: 1.5px solid #f2d796;
  box-shadow: 0 4px 12px rgba(180,120,30,.16), inset 0 0 0 3px rgba(255,255,255,.55); }
.hm-blk.place .hmc { border-color: #e6dd9c; }
.hmc-pic { height: 10.5rem; border-radius: 12px; }
.hmc-ph { background: url("../img/hm/nen-nui.jpg") center / cover no-repeat; }
.hmc-ph-ic { width: 4.4rem; height: 4.4rem; }
.hm-blk.place .hmc-ph-ic { color: #9c4a17; }
.hmc-badge { left: .55rem; top: .55rem; border-radius: 9px; padding: .3rem .75rem; font-size: .9rem; background: linear-gradient(180deg, #d72a22, #a3141a); box-shadow: 0 2px 6px rgba(120,20,10,.35); }
.hmc-zoom { background: rgba(60,50,40,.62); border-radius: 10px; }
.hmc-chip { border-radius: 999px; background: #fff3c2; border: 1.5px solid #f0cf6a; color: #4a2a10; padding: .28rem .8rem; }
.hmc-in { padding: .65rem .55rem .3rem; gap: .25rem; }
.hmc-t { color: #a3141a; font-size: 1.15rem; font-weight: 800; }
.hmc-meta { color: #4a3a2a; font-size: .9rem; }
.hmc-meta .hm-i { color: #4a3a2a; }
.hmc-meta .hm-i.red { color: #c8261f; }
.hmc-meta .views { color: #4a3a2a; }
.hmc-more { padding: .4rem 1rem; border: 1.5px solid #eec46c; color: #7a2410; background: linear-gradient(180deg, #fff1d0, #f8d793); box-shadow: 0 2px 5px rgba(150,90,20,.18); }
.hmc-act { gap: .4rem; padding: .35rem .3rem .3rem; }
.hmc-btn { min-height: 2.65rem; border-radius: 12px; border: 1.5px solid #d9b479; background: #fffbf2; color: #3e2410; font-weight: 700; }
.hmc-btn .hm-i { color: #a06a20; }
.hmc-btn.go { border-radius: 10px; border-color: #1d3f0f; background: linear-gradient(180deg, #2f5d1a, #1b3d0d); box-shadow: 0 3px 7px rgba(20,50,10,.35); }
.hm-duo-foot { height: auto; aspect-ratio: 1265 / 126; margin: -.6rem -.9rem 0; background: url("../img/hm/chan-song-sen.jpg") bottom / 100% 100% no-repeat; }
.hm-duo-lotus { display: none; }
@media (max-width: 599px) {
  .hm-duo { padding: .7rem .6rem 0; }
  .hm-blk::before { right: -.6rem; height: 4.2rem; }
  .hm-blk.place::before { height: 3.6rem; }
  .hm-blk-tab { font-size: 1.15rem; padding: .45rem 1.8rem .45rem .8rem; }
  .hm-blk-ic { width: 1.8rem; height: 1.8rem; }
  .hm-cloud { width: 4.6rem; height: 2rem; margin-left: -1.4rem; }
  .hm-duo-foot { margin: -.4rem -.6rem 0; aspect-ratio: 1265 / 180; background-size: cover; background-position: center bottom; }
}
.hm-blk::before { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%), linear-gradient(180deg, #000 72%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 18%), linear-gradient(180deg, #000 72%, transparent); mask-composite: intersect; }
.hmc-act { gap: .35rem; }
.hmc-btn { gap: .25rem; padding: .3rem .45rem; font-size: .8rem; }
.hmc-btn .hm-i { width: .95rem; height: .95rem; }
.hmc-btn.go { font-size: .9rem; padding: .3rem .7rem; }
.hmc-act { gap: .3rem; padding: .35rem 0 .2rem; }
.hmc-btn { gap: .2rem; padding: .3rem .4rem; font-size: .75rem; }
.hmc-btn .hm-i { width: .85rem; height: .85rem; }
.hmc-btn.go { font-size: .84rem; padding: .3rem .55rem; }
.hmc-act { gap: .2rem; }
.hmc-btn { padding: .3rem .25rem; }
.hmc-btn.go { padding: .3rem .45rem; }
.hmc-btn { border-width: 1px; }
.hmc-btn.go { font-size: .8rem; padding: .3rem .4rem; }
/* 1.5.8: Trang Hội - Lễ - Giỗ chạp kiểu đỏ – vàng theo mẫu (ảnh nền cắt từ mẫu: assets/img/gio/) */
.gio-page { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-dark: #7a0c10; --gp-gold2: #e6b155; --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif; }
.gpg-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.1rem; min-height: 5.6rem; margin-bottom: 1rem; padding: .7rem 1.4rem; border-radius: 22px; color: #fff;
  background: linear-gradient(100deg, #8f0d12, #c11d1b 45%, #d7442a); box-shadow: 0 4px 14px rgba(120,20,10,.25), inset 0 -3px 0 #f1c35e; }
.gpg-banner::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: min(62%, 44rem); pointer-events: none;
  background: url("../img/gio/banner-canh.jpg") right center / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%); mask-image: linear-gradient(90deg, transparent 0, #000 30%); }
.gpg-banner > * { position: relative; z-index: 1; }
.gpg-cal { flex: none; display: inline-flex; width: 4.6rem; height: 4rem; padding: .35rem .5rem; border-radius: 16px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1.5px rgba(255,230,170,.35); color: #fff; }
.gpg-cal svg { width: 100%; height: 100%; }
.gpg-bt { min-width: 0; }
.gpg-bt1 { font-family: var(--gp-serif); font-size: 1.85rem; font-weight: 700; line-height: 1.2; text-shadow: 0 2px 3px rgba(0,0,0,.25); }
.gpg-bt1 .gold { color: #ffd463; }
.gpg-bt2 { margin-top: .2rem; font-style: italic; font-size: 1.05rem; color: #fff3dc; }
.gpg-head { display: flex; align-items: center; gap: .7rem; margin: .4rem 0 .9rem; }
.gpg-sen { width: 4.4rem; height: auto; flex: none; }
.gpg-head h1 { margin: 0; font-family: var(--gp-serif); color: var(--gp-red); font-size: 2rem; white-space: nowrap; }
.gpg-line { flex: 1; height: 2px; min-width: 1rem; background: linear-gradient(90deg, #e6b155, rgba(230,177,85,.25)); }
.gpg-add.btn { flex: none; border-radius: 999px; padding: .45rem 1.3rem; background: linear-gradient(180deg, #c8261f, #8e0d12); border: 0; color: #fff; font-weight: 800;
  box-shadow: 0 3px 8px rgba(120,20,10,.3), inset 0 1px 0 rgba(255,255,255,.25); }
/* tab nhóm */
.gio-page .muc-tabs { gap: .7rem; margin-bottom: 1rem; }
.gio-page .muc-tab { min-height: 3rem; padding: .3rem .7rem .3rem 1.1rem; gap: .55rem; font-size: 1.05rem; font-weight: 600; border: 1.5px solid #ecc874; color: #3a1d0b;
  background: linear-gradient(180deg, #fffbee, #fdeccb); box-shadow: 0 2px 6px rgba(150,90,20,.15); }
.gio-page .muc-tab .n { min-width: 1.9rem; line-height: 1.9rem; padding: 0 .35rem; border-radius: 999px; background: #fbe2a6; color: #3a1d0b; font-weight: 800; }
.gio-page .muc-tab .ic, .gio-page .mt-ic { display: inline-flex; width: 1.35rem; height: 1.35rem; color: #5a2a10; }
.gio-page .mt-ic svg { width: 100%; height: 100%; }
.gio-page .muc-tab .ev-star { font-size: 1.3rem; color: #f2b10a; animation: none; text-shadow: 0 1px 0 #b36a00; }
.gio-page .muc-tab.m-thuong { background: linear-gradient(180deg, #fffbee, #fdeccb); border-color: #ecc874; color: #3a1d0b; }
.gio-page .muc-tab.m-to { background: linear-gradient(180deg, #d42a22, #9c1016); border-color: #7a0c10; color: #fff3c4; }
.gio-page .muc-tab.m-to .n { background: #ffd463; color: #7a0c10; }
.gio-page .muc-tab.m-ho { background: linear-gradient(180deg, #fff3c4, #fbd978); border-color: #e7b84a; color: #3a1d0b; }
.gio-page .muc-tab.m-ho .n { background: #fff7d6; }
.gio-page .muc-tab.on { box-shadow: 0 0 0 3px #fff8ea, 0 0 0 5.5px #e6a93a, 0 4px 10px rgba(150,90,20,.3); }
.gio-page .muc-tab.m-all.on { background: linear-gradient(180deg, #fff3d4, #f8d793); color: #3a1d0b; border-color: #e6a93a; }
.gio-page .muc-tab.m-all.on .n { background: #fff; }
/* bộ lọc */
.gpg-filters.card { position: relative; overflow: hidden; padding: .9rem 1.2rem 1rem; border-radius: 18px; border: 1.5px solid #f0d596; box-shadow: 0 3px 12px rgba(150,90,20,.12);
  background: linear-gradient(180deg, #fffdf6, #fff7e6); }
.gpg-filters.card::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 19rem; pointer-events: none;
  background: url("../img/gio/hoa-sen.jpg") right bottom / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 35%); mask-image: linear-gradient(90deg, transparent 0, #000 35%); }
.gpg-filters > * { position: relative; z-index: 1; }
.gpg-filters .f-lbl { color: var(--gp-red); font-weight: 800; font-size: 1.05rem; }
.gpg-filters .f-lbl .ic { color: var(--gp-red2); }
.gpg-filters .fchip { min-height: 2.7rem; border: 1.5px solid #ecc874; background: linear-gradient(180deg, #fffdf4, #fdf1d6); color: #3a1d0b; box-shadow: 0 2px 4px rgba(150,90,20,.1); }
.gpg-filters .fchip .n { background: #fbe2a6; color: #3a1d0b; font-weight: 800; }
.gpg-filters .fchip:hover { border-color: #d29a2c; }
.gpg-filters .fchip.on { background: linear-gradient(180deg, #3f7f23, #23510f); border-color: #1d430c; color: #fff; }
.gpg-filters .fchip.on .n { background: #ffd463; color: #23510f; }
/* nhóm tháng */
.gm-sec { margin-top: 1.4rem; }
.gm-h { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; }
.gio-page .gm-tab { display: flex; align-items: center; margin: 0; height: 3.4rem; aspect-ratio: 540 / 56; max-width: calc(100% - 9rem); padding: 0 0 .2rem 21%; box-sizing: border-box;
  background: url("../img/gio/thang-tab.jpg") left bottom / 100% 100% no-repeat; color: #fff; font-family: var(--gp-serif); font-size: 1.4rem; font-weight: 700; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.gm-left { display: inline-flex; align-items: center; gap: .4rem; flex: none; margin-bottom: .35rem; padding: .4rem 1rem; border-radius: 999px; border: 1.5px solid #ecc874;
  background: linear-gradient(180deg, #fffbee, #fde9bd); color: #3a1d0b; font-weight: 800; font-size: 1rem; white-space: nowrap; box-shadow: 0 2px 6px rgba(150,90,20,.18); }
.gm-left .ic { width: 1.2rem; height: 1.2rem; color: var(--gp-red2); }
.gm-left.soon { background: linear-gradient(180deg, #d42a22, #9c1016); color: #fff3c4; border-color: #7a0c10; }
.gm-left.soon .ic { color: #ffd463; }
.gm-left.sm { margin: 0 0 0 auto; padding: .2rem .7rem; font-size: .85rem; }
.gm-body { display: grid; gap: .8rem; margin-top: -2px; padding: .9rem; border: 1.5px solid #f0d596; border-radius: 0 18px 18px 18px;
  background: linear-gradient(180deg, #fffaf0, #fff5e2); box-shadow: 0 4px 14px rgba(150,90,20,.12); }
/* thẻ lễ / giỗ */
.gio-page .ev.gc, .gio-page .ev.gc.ev-muc-to, .gio-page .ev.gc.ev-muc-ho, .gio-page .ev.gc.ev-muc-thuong {
  display: grid; grid-template-columns: 8.4rem minmax(0, 1fr) auto; align-items: center; gap: 1.1rem; padding: .3rem; border: 0; border-radius: 14px; background: transparent; color: #3a1d0b; box-shadow: none; }
.gio-page .ev.gc + .ev.gc { padding-top: 1rem; border-top: 1.5px dashed #ecd29a; border-radius: 0; }
.gio-page .ev.gc:hover .ev-title { text-decoration: underline; text-decoration-color: #e6b155; }
.gc-date { align-self: start; overflow: hidden; text-align: center; border-radius: 14px; border: 1.5px solid #ecc874; background: linear-gradient(180deg, #fffdf6, #fdf0d2);
  box-shadow: 0 3px 8px rgba(150,90,20,.18); }
.gc-dm { padding: .4rem 0; background: linear-gradient(180deg, #d42a22, #9c1016); color: #fff; font-weight: 800; font-size: 1.05rem; }
.gc-date b { display: block; padding-top: .35rem; font-family: var(--gp-serif); font-size: 3.1rem; line-height: 1; color: var(--gp-red2); }
.gc-date small { display: block; margin: .2rem .6rem .45rem; padding-top: .25rem; border-top: 1.5px solid #ecc874; font-weight: 800; font-size: .98rem; color: #3a1d0b; }
.gc-date.alt .gc-dm { background: linear-gradient(180deg, #3f7f23, #23510f); }
.gc-date.alt b { color: #2f6b1f; }
.gc-body { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.gc-top { display: flex; align-items: center; gap: .5rem; }
.gio-page .gc-muc { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; color: #7a3a10; }
.gio-page .gc-muc .ev-star { color: #f2b10a; font-size: 1.15rem; animation: none; text-shadow: 0 1px 0 #b36a00; }
.gio-page .gc-muc .ic { width: 1.1rem; height: 1.1rem; color: #5a2a10; }
.gio-page .ev-muc-ho .gc-muc .ev-star { color: #d10f1b; text-shadow: none; }
.gc-title { line-height: 1.3; }
.gio-page .gc .ev-title, .gio-page .ev-muc-to .ev-title, .gio-page .ev.ev-muc-ho .ev-title { color: var(--gp-red); font-family: var(--gp-serif); font-size: 1.28rem; font-weight: 700; animation: none; }
.gc-sub { color: var(--gp-red2); font-weight: 700; font-size: 1rem; }
.gc-line { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .45rem; font-size: .95rem; color: #3a1d0b; }
.gc-line > .ic { width: 1.1rem; height: 1.1rem; color: var(--gp-red2); }
.gc-line .views { margin-left: .3rem; color: #6a5440; }
.gio-page .gc .ev-meta { margin: 0; gap: .25rem 1.1rem; color: #3a1d0b; font-size: .95rem; }
.gio-page .gc .ev-meta .ic { color: var(--gp-red2); }
.gio-page .gc .ev-meta a.link { color: #3a1d0b; text-decoration: none; font-weight: 600; }
.gio-page .gc .ev-meta a.tel { display: inline-flex; align-items: center; gap: .2rem; color: var(--gp-red2); font-weight: 800; text-decoration: none; }
.gc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .2rem; }
.gc-info { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.4rem; padding: .2rem .9rem .2rem .45rem; border-radius: 999px; border: 1.5px solid #9cc77a;
  background: linear-gradient(180deg, #f3fbe8, #ddf0c6); color: #1f4a10; font-weight: 700; font-size: .92rem; }
.gc-info .ic { width: 1.35rem; height: 1.35rem; padding: .15rem; border-radius: 50%; background: #3a8a22; color: #fff; }
.gio-page .gc .sb-btn { min-height: 2.4rem; padding: .2rem .85rem; border: 1.5px solid #ecc874; background: linear-gradient(180deg, #fffdf6, #fdf1d6); color: #3a1d0b; font-weight: 600; }
.gio-page .gc .sb-btn:hover { border-color: #d29a2c; }
.gio-page .gc .sb-btn.zalo { color: #0050c8; }
.gio-page .gc .sb-btn.fb { color: #1259c3; }
.gio-page .gc .muc-ticks { margin-top: .15rem; }
.gio-page .gc .muc-tick { min-height: 2.4rem; padding: .2rem .9rem .2rem .45rem; background: #fffdf6; border: 1.5px solid #e2c48a; color: #3a1d0b; font-weight: 600; }
.gio-page .gc .muc-tick .box { border-color: #8a6a3a; background: #fff; }
.gio-page .gc .muc-tick.on { background: linear-gradient(180deg, #d42a22, #9c1016); border-color: #7a0c10; color: #fff; }
.gio-page .gc .muc-tick.on .box { background: #fff3c4; border-color: #ffd463; color: var(--gp-red); }
.gio-page .gc .ev-thumb { width: 17rem; height: 10.5rem; align-self: center; border-radius: 14px; border: 2px solid #f0d596; box-shadow: 0 3px 10px rgba(150,90,20,.2); }
.gio-page .gc .ev-thumb .cnt { right: .5rem; bottom: .5rem; padding: .15rem .55rem; border-radius: 8px; font-size: .9rem; }
.gio-page .gc .ev-thumb.none { opacity: 1; border-style: solid; background: url("../img/hm/nen-nui.jpg") center / cover; color: #9c4a17; }
.gio-page .gc .ev-thumb.none .ic { width: 2.6rem; height: 2.6rem; }
.gio-page .gc .ev-thumb.none small { font-weight: 700; color: #7a4a20; }
.gpg-foot { height: auto; aspect-ratio: 1358 / 129; margin: 1rem -1rem 0; background: url("../img/gio/chan-song-sen.jpg") center bottom / 100% 100% no-repeat; }
@media (max-width: 1100px) { .gio-page .gc .ev-thumb { width: 12rem; height: 8rem; } }
@media (max-width: 899px) {
  .gpg-bt1 { font-size: 1.5rem; }
  .gio-page .ev.gc, .gio-page .ev.gc.ev-muc-to, .gio-page .ev.gc.ev-muc-ho, .gio-page .ev.gc.ev-muc-thuong { grid-template-columns: 6.6rem minmax(0, 1fr); }
  .gio-page .gc > .ev-thumb { grid-column: 1 / -1; width: 100%; height: 11rem; }
  .gio-page .gc > .ev-thumb.none { display: none; }
}
@media (max-width: 599px) {
  .gpg-banner { gap: .7rem; padding: .6rem .8rem; min-height: 4.6rem; border-radius: 16px; }
  .gpg-banner::after { width: 75%; opacity: .55; }
  .gpg-cal { width: 3.3rem; height: 2.9rem; padding: .25rem .35rem; border-radius: 12px; }
  .gpg-bt1 { font-size: 1.15rem; }
  .gpg-bt2 { font-size: .82rem; }
  .gpg-head { flex-wrap: wrap; gap: .5rem; }
  .gpg-sen { width: 3rem; }
  .gpg-head h1 { font-size: 1.45rem; }
  .gpg-add.btn { width: 100%; justify-content: center; }
  .gio-page .muc-tabs { gap: .45rem; }
  .gio-page .muc-tab { min-height: 2.6rem; font-size: .92rem; padding: .2rem .5rem .2rem .8rem; }
  .gpg-filters.card { padding: .7rem .7rem .8rem; }
  .gpg-filters.card::after { width: 11rem; opacity: .6; }
  .gio-page .gm-tab { height: 2.6rem; font-size: 1.05rem; max-width: calc(100% - 7rem); }
  .gm-left { padding: .3rem .65rem; font-size: .82rem; }
  .gm-body { padding: .6rem; border-radius: 0 14px 14px 14px; }
  .gio-page .ev.gc, .gio-page .ev.gc.ev-muc-to, .gio-page .ev.gc.ev-muc-ho, .gio-page .ev.gc.ev-muc-thuong { grid-template-columns: 4.8rem minmax(0, 1fr); gap: .65rem; }
  .gc-dm { font-size: .78rem; padding: .25rem 0; }
  .gc-date b { font-size: 2.1rem; }
  .gc-date small { font-size: .72rem; margin: .15rem .3rem .3rem; }
  .gio-page .gc .ev-title { font-size: 1.08rem; }
  .gc-line, .gio-page .gc .ev-meta { font-size: .85rem; }
  .gio-page .gc .sb-btn, .gc-info, .gio-page .gc .muc-tick { min-height: 2.2rem; font-size: .8rem; padding: .15rem .55rem; }
  .gio-page .gc > .ev-thumb { height: 9rem; }
  .gpg-foot { margin: .8rem -1rem 0; aspect-ratio: 1358 / 200; background-size: cover; }
}
.gc-line { flex-wrap: nowrap; align-items: flex-start; }
.gc-line > .ic { margin-top: .15rem; flex: none; }
.gc-line .views { margin-left: .4rem; }
.gc-muc { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gio-page .gm-tab { color: #fff; }
@media (max-width: 599px) {
  .gpg-banner::after { width: 55%; opacity: .35; }
  .gm-h { gap: .4rem; }
  .gio-page .gm-tab { flex: 1 1 auto; min-width: 0; width: auto; max-width: none; aspect-ratio: auto; height: 2.5rem; padding-left: 4.2rem; font-size: 1rem; background-size: auto 100%; background-color: transparent; }
  .gm-left { margin-bottom: .25rem; }
  .gio-page .ev.gc, .gio-page .ev.gc.ev-muc-to, .gio-page .ev.gc.ev-muc-ho, .gio-page .ev.gc.ev-muc-thuong { display: block; }
  .gio-page .gc .gc-date { float: left; width: 4.8rem; margin: 0 .65rem .4rem 0; }
  .gio-page .gc .gc-body { display: block; }
  .gio-page .gc .gc-body > * { margin-bottom: .3rem; }
  .gio-page .gc .gc-acts, .gio-page .gc .muc-ticks { clear: both; }
  .gio-page .gc > .ev-thumb { clear: both; display: block; width: 100%; margin-top: .5rem; }
}
.gio-page .gm-tab { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.gio-page .ev.gc .gc-muc, .gio-page .ev.gc.ev-muc-thuong .gc-muc { color: #7a3a10; }
@media (max-width: 599px) {
  .gio-page .gm-tab { padding-left: 3.6rem; font-size: .92rem; -webkit-mask-image: none; mask-image: none; }
  .gm-left { padding: .25rem .55rem; font-size: .78rem; }
  .gm-left .ic { width: 1rem; height: 1rem; }
  .gc-top { flex-wrap: wrap; gap: .25rem .5rem; }
  .gm-left.sm { margin-left: 0; }
}

/* 1.5.9: Trang chủ — slide Giỗ Tổ - Lễ lớn, Lễ dòng họ (chuyển qua lại) */
.sec-h.hero-h { display: flex; align-items: center; gap: .6rem; }
.hero-n { padding: .1rem .7rem; border-radius: 999px; background: #fde9bd; border: 1.5px solid #ecc874; color: #7a0c10; font-size: .85rem; font-weight: 800; }
.slider.hero { border-radius: 20px; border: 2px solid #e6b155; box-shadow: 0 4px 14px rgba(120,20,10,.25); }
.slider.hero .hero-bg.plain { background: radial-gradient(120% 140% at 85% 20%, #c8361f 0, #8f1a10 45%, #5e0c08 100%); }
.slider.hero .hero-in { padding-left: 4.4rem; padding-right: 4.4rem; }
.hero-pos { position: absolute; z-index: 2; top: .8rem; right: 1rem; padding: .15rem .65rem; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,212,99,.6); color: #ffd463; font-weight: 800; font-size: .85rem; }
.slider.hero .sl-nav { z-index: 3; width: 2.9rem; height: 2.9rem; background: linear-gradient(180deg, #fff6dc, #f4cd7a); color: #7a0c10; border: 2px solid #c98a2a; }
.slider.hero .sl-nav:hover { background: #ffd463; }
.slider.hero .sl-dots { z-index: 3; left: 3.5rem; right: 3.5rem; pointer-events: none; }
.slider.hero .sl-dots button { pointer-events: auto; }
.slider.hero .sl-dots button.on { background: #ffd463; border-color: #ffd463; }
@media (max-width: 599px) {
  .slider.hero .hero-in { padding: 2.7rem 1rem 3.2rem; }
  .hero-pos { top: .6rem; right: auto; left: 1rem; }
  .slider.hero .sl-nav { display: grid; top: auto; bottom: .35rem; transform: none; width: 2.3rem; height: 2.3rem; font-size: 1.4rem; }
  .slider.hero .sl-dots { bottom: 1rem; }
}

/* 1.5.9: Trang Ký sự kiểu đỏ – vàng theo mẫu (ảnh nền cắt từ mẫu: assets/img/ks/) */
.ks-page { --gp-red: #a3141a; --gp-red2: #c8261f; --gp-serif: "Noto Serif", "Times New Roman", "Tinos", Georgia, serif; position: relative; }
.ki { display: inline-flex; flex: none; width: 1.15rem; height: 1.15rem; }
.ki svg { width: 100%; height: 100%; }
.ksp-banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.2rem; min-height: 6.4rem; margin-bottom: 1.1rem; padding: .7rem 1.6rem; border-radius: 22px; color: #fff;
  background: linear-gradient(100deg, #7f0b10, #b3171a 40%, #d23a25); box-shadow: 0 4px 14px rgba(120,20,10,.25), inset 0 -3px 0 #f1c35e; }
.ksp-banner::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: min(60%, 36rem); pointer-events: none;
  background: url("../img/ks/banner-canh.jpg") right center / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%); mask-image: linear-gradient(90deg, transparent 0, #000 32%); }
.ksp-banner > * { position: relative; z-index: 1; }
.ks-page .ksp-book { width: 4.4rem; height: 3.6rem; color: #f6c75a; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.ksp-bt { min-width: 0; }
.ksp-bt h1 { margin: 0; font-family: var(--gp-serif); font-size: 2.3rem; line-height: 1.15; color: #fff; text-shadow: 0 2px 3px rgba(0,0,0,.3); }
.ksp-bt h1 .gold { color: #ffd463; }
.ksp-sub { margin-top: .15rem; font-style: italic; font-size: 1.08rem; color: #fff3dc; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.ksp-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.ksp-desc { flex: 1; min-width: 0; margin: 0; padding: .1rem 0 .1rem 1rem; border-left: 4px solid #e6b155; color: #3a2a1a; line-height: 1.6; }
.ks-page .ksp-add.btn { flex: none; gap: .5rem; min-height: 3.1rem; padding: .3rem 1.5rem; border: 0; border-radius: 14px; font-size: 1.1rem; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #c8261f, #8e0d12); box-shadow: 0 4px 10px rgba(120,20,10,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.ks-page .ksp-add .ki { width: 1.2rem; height: 1.2rem; }
/* hàng lọc */
.ks-page .chip-row { align-items: center; gap: .7rem; margin: .2rem 0 .9rem; }
.ks-page .chip-row .lbl { min-width: 7.6rem; font-family: var(--gp-serif); font-weight: 700; font-size: 1.3rem; color: var(--gp-red); }
.ks-page .rel-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.9rem; padding: .25rem 1.25rem; border-radius: 999px; border: 1.5px solid #ecc874;
  background: linear-gradient(180deg, #fffdf4, #fdf1d6); color: #2a1a0c; font-weight: 700; font-size: 1.02rem; box-shadow: 0 2px 5px rgba(150,90,20,.12); }
.ks-page .rel-chip:hover { border-color: #d29a2c; }
.ks-page .rel-chip .ki { width: 1.3rem; height: 1.3rem; color: #5a2a10; }
.ks-page .rel-chip.on { background: linear-gradient(180deg, #c8261f, #8e0d12); border-color: #7a0c10; color: #fff; box-shadow: 0 3px 8px rgba(120,20,10,.3); }
.ks-page .rel-chip.on .ki { color: #ffd463; }
.ks-page .rel-chip.hot:not(.on) { border-color: #e39a1e; background: linear-gradient(180deg, #fff6d8, #fde0a0); }
/* lưới thẻ: chừa cột phải cho cảnh đình – hoa sen trên màn hình rộng */
.ks-page .ksp-grid { position: relative; z-index: 1; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.1rem; }
@media (min-width: 1300px) {
  .ks-page::before { content: ""; position: absolute; z-index: 0; right: 0; top: 15rem; width: 16rem; height: 38rem; pointer-events: none;
    background: url("../img/ks/nen-dinh-sen.jpg") right top / 100% auto no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 25%), linear-gradient(180deg, transparent 0, #000 8%, #000 88%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 25%), linear-gradient(180deg, transparent 0, #000 8%, #000 88%, transparent 100%);
    mask-composite: intersect; }
  .ks-page .ksp-grid { margin-right: 15rem; }
  .ks-page .chip-row, .ks-page .ksp-intro { position: relative; z-index: 1; }
}
.ks-page .ks-item { border: 2px solid #f0d596; border-radius: 18px; background: #fffdf8; box-shadow: 0 4px 14px rgba(150,90,20,.16); }
.ks-page .ks-item:has(.st-cho) { border: 2px dashed #e39a1e; }
.ncard.ksc { border: 2px solid #f0d596; border-radius: 18px; background: #fffdf8; box-shadow: 0 4px 14px rgba(150,90,20,.16); }
.ks-item > .ncard.ksc { border: 0; box-shadow: none; background: transparent; }
.ksc-pic { position: relative; margin: .4rem .4rem 0; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 8; background: #efe3d1; }
.ncard.ksc .ksc-pic img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; display: block; }
.ksc-pic.none { display: grid; place-items: center; background: url("../img/hm/nen-nui.jpg") center / cover; }
.ks-page .ksc-ph { width: 4.4rem; height: 3.6rem; color: #b5782a; opacity: .8; }
.ksc-badge { position: absolute; left: .7rem; bottom: .7rem; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .9rem; border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0, #fde9bd); border: 1px solid #ecc874; color: #2a1a0c; font-weight: 700; font-size: .95rem; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ks-page .ksc-badge .ki { width: 1.15rem; height: 1.15rem; color: #b5631a; }
.ksc-badge.blog .ki { color: #145866; }
.ksc-star { position: absolute; top: .6rem; left: .6rem; padding: .15rem .65rem; border-radius: 999px; background: #b3121b; color: #ffd463; font-weight: 800; font-size: .82rem; border: 1px solid #ffd463; }
.ncard-in.ksc-in { padding: .8rem 1.1rem .9rem; gap: .35rem; align-self: stretch; }
.ksc-t, .ncard-in b.ksc-t { font-family: var(--gp-serif, Georgia, serif); color: #a3141a; font-size: 1.45rem; line-height: 1.25; margin-bottom: .15rem; }
.ksc-line { display: flex; align-items: center; gap: .55rem; color: #3a2a1a; font-size: 1.02rem; }
.ks-page .ksc-line .ki { width: 1.3rem; height: 1.3rem; color: #b5631a; }
.ksc-sum { align-self: stretch; margin-top: .35rem; padding-top: .6rem; border-top: 1.5px solid #f1e3c4; color: #3a2a1a; }
.ks-page .ks-act { gap: .55rem; padding: .3rem 1.1rem 1rem; border-top: 0; background: transparent; }
.ks-page .ks-act .btn.sm { gap: .4rem; min-height: 2.6rem; padding: .2rem 1.1rem; border-radius: 999px; border: 1.5px solid #c9905a; background: #fffdf8; color: #3a1d0b; font-size: .98rem; font-weight: 700; }
.ks-page .ks-act .btn.sm:hover { background: #fff3dc; }
.ks-page .ks-act .ki { width: 1.2rem; height: 1.2rem; }
.ks-page .ks-act .ka-edit .ki { color: #7a3a10; }
.ks-page .ks-act .btn.ka-del { border-color: #e3707a; color: #c8121b; }
.ks-page .ks-act .btn.ka-ok { border-color: #5aa83a; color: #1f5a10; background: #f3fbe8; }
.ks-page .ks-item:not(:has(.ksc-sum)) .ks-act { padding-top: .6rem; border-top: 1.5px solid #f1e3c4; margin: 0 1.1rem; padding-left: 0; padding-right: 0; }
.ksp-foot { height: auto; aspect-ratio: 1319 / 218; margin: 1.2rem -1rem -1rem; background: url("../img/ks/chan-song-sen.jpg") center bottom / 100% 100% no-repeat; }
@media (max-width: 899px) {
  .ksp-bt h1 { font-size: 1.8rem; }
  .ksp-sub { font-size: .95rem; }
  .ks-page .chip-row { flex-wrap: wrap; overflow: visible; }
  .ks-page .chip-row .lbl { min-width: 0; width: 100%; font-size: 1.15rem; }
}
@media (max-width: 599px) {
  .ksp-banner { gap: .7rem; min-height: 5rem; padding: .6rem .9rem; border-radius: 16px; }
  .ksp-banner::after { width: 55%; opacity: .55; }
  .ks-page .ksp-book { width: 3rem; height: 2.5rem; }
  .ksp-bt h1 { font-size: 1.5rem; }
  .ksp-sub { font-size: .85rem; }
  .ksp-intro { flex-direction: column; align-items: stretch; }
  .ks-page .ksp-add.btn { justify-content: center; }
  .ks-page .chip-row { gap: .45rem; }
  .ks-page .rel-chip { min-height: 2.5rem; padding: .2rem .85rem; font-size: .92rem; }
  .ksc-t, .ncard-in b.ksc-t { font-size: 1.25rem; }
  .ks-page .ks-act { gap: .4rem; padding-left: .9rem; padding-right: .9rem; }
  .ks-page .ks-act .btn.sm { padding: .15rem .75rem; font-size: .92rem; }
  .ksp-foot { margin: 1rem -1rem -1rem; }
}

/* 1.6.1: Hội - Lễ - Giỗ chạp — nhãn tháng co giãn theo chữ (hoa sen trái · dải đỏ giữa · mây phải), khung lọc nền trắng, thẻ theo nhóm: Giỗ Tổ đỏ · Lễ dòng họ vàng · Ngày kỵ xanh dương nhạt */
.gio-page .gm-tab { --th: 3.4rem; display: inline-flex; align-items: center; flex: 0 1 auto; width: auto; min-width: 0; max-width: calc(100% - 9rem); height: var(--th); aspect-ratio: auto;
  padding: 0 calc(var(--th) * 3.05) .15rem calc(var(--th) * 2.2); box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: url("../img/gio/tab-trai.png") left bottom / auto 100% no-repeat, url("../img/gio/tab-phai.png") right bottom / auto 100% no-repeat,
    url("../img/gio/tab-giua.png") left bottom / auto 100% repeat-x;
  background-origin: border-box; -webkit-mask-image: none; mask-image: none; font-size: 1.4rem; }
@media (max-width: 899px) { .gio-page .gm-tab { --th: 2.7rem; font-size: 1.1rem; max-width: calc(100% - 7.5rem); } }
@media (max-width: 599px) { .gio-page .gm-h { flex-wrap: wrap; } .gio-page .gm-tab { --th: 2.3rem; font-size: .92rem; max-width: 100%; padding-left: calc(var(--th) * 2.1); padding-right: calc(var(--th) * 2.7); }
  .gio-page .gm-h .gm-left:not(.sm) { margin: 0 0 .3rem auto; } }
.gpg-filters.card { background: #fff; }
.gpg-filters.card::after { background-image: url("../img/gio/hoa-sen-trang.jpg"); }
.gio-page .ev.gc, .gio-page .ev.gc.ev-muc-to, .gio-page .ev.gc.ev-muc-ho, .gio-page .ev.gc.ev-muc-thuong,
.gio-page .ev.gc + .ev.gc { padding: .9rem; border: 1.5px solid #e9d29a; border-radius: 16px; box-shadow: 0 2px 8px rgba(150,90,20,.12); }
.gio-page .ev.gc.ev-muc-thuong { background: linear-gradient(180deg, #f1f8fe, #dcedfa); border-color: #a9cfee; }
.gio-page .ev.gc.ev-muc-ho { background: linear-gradient(180deg, #fff7d6, #fde39a); border-color: #e3b443; }
.gio-page .ev.gc.ev-muc-to { background: linear-gradient(180deg, #c01d1d, #8c0d11); border-color: #6e0a0d; color: #fff3dc; }
.gio-page .ev.gc.ev-muc-to .ev-title, .gio-page .ev.gc.ev-muc-to .gc-muc, .gio-page .ev.gc.ev-muc-to .gc-sub { color: #ffd463; }
.gio-page .ev.gc.ev-muc-to .gc-muc .ev-star { color: #ffd463; text-shadow: none; }
.gio-page .ev.gc.ev-muc-to .gc-line, .gio-page .ev.gc.ev-muc-to .ev-meta, .gio-page .ev.gc.ev-muc-to .ev-meta a.link, .gio-page .ev.gc.ev-muc-to .gc-line .views { color: #fff3dc; }
.gio-page .ev.gc.ev-muc-to .gc-line > .ic, .gio-page .ev.gc.ev-muc-to .ev-meta .ic, .gio-page .ev.gc.ev-muc-to .ev-meta a.tel { color: #ffd463; }
.gio-page .ev.gc.ev-muc-to:hover .ev-title { text-decoration-color: #fff3dc; }
.gio-page .ev.gc.ev-muc-to .gm-left.sm { background: linear-gradient(180deg, #fffbee, #fde9bd); color: #3a1d0b; border-color: #ecc874; }
.gio-page .ev.gc.ev-muc-to .gm-left.sm .ic { color: var(--gp-red2); }
.gio-page .ev.gc.ev-muc-thuong .gc-muc, .gio-page .ev.gc.ev-muc-thuong .gc-muc .ic { color: #1d5d8f; }

/* 1.6.2: Trang chủ — Ký sự / Địa danh: 6 thẻ mỗi trang (2 hàng × 3 cột), trượt qua lại riêng từng khối */
.hm-pager { position: relative; }
.hm-view { overflow: hidden; margin: -.35rem; transition: height .35s ease; }
.hm-track { display: flex; align-items: flex-start; transition: transform .45s ease; will-change: transform; }
.hm-cards.hm-page { flex: 0 0 100%; min-width: 0; box-sizing: border-box; padding: .35rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 899px) { .hm-cards.hm-page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .hm-cards.hm-page { grid-template-columns: 1fr; } }
.hm-pctl { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: .8rem; }
.hm-nav { width: 2.6rem; height: 2.6rem; flex: none; display: grid; place-items: center; padding: 0 0 .15rem; border-radius: 50%; border: 2px solid #c98a2a;
  background: linear-gradient(180deg, #fff6dc, #f4cd7a); color: var(--bkt, #7a0c10); font-size: 1.7rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(150,90,20,.25); }
.hm-nav:hover { background: #ffd463; }
.hm-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.hm-dots button { width: .8rem; height: .8rem; padding: 0; border-radius: 50%; border: 2px solid var(--bkg, #a3141a); background: transparent; cursor: pointer; }
.hm-dots button.on { background: var(--bkg, #a3141a); width: 1.6rem; border-radius: 999px; }
.hm-pos { min-width: 3.2rem; text-align: center; font-weight: 800; font-size: .9rem; color: var(--bkt, #7a0c10); }
.hm-blk.place .hm-nav { color: #23510f; }
.hm-blk.place .hm-dots button { border-color: #2f6b1f; }
.hm-blk.place .hm-dots button.on { background: #2f6b1f; }
.hm-blk.place .hm-pos { color: #23510f; }
/* 1.6.3: nút ‹ › trượt đặt hai bên khối (giữa chiều cao thẻ); màn hình hẹp thì nằm trên mép thẻ */
.hm-pager > .hm-nav { position: absolute; z-index: 3; top: calc(50% - 1.9rem); transform: translateY(-50%); width: 3.4rem; height: 3.4rem; font-size: 2.2rem; }
.hm-pager > .hm-nav.prev { left: -.8rem; }
.hm-pager > .hm-nav.next { right: -.8rem; }
@media (min-width: 1500px) {
  .hm-pager > .hm-nav.prev { left: -5.2rem; }
  .hm-pager > .hm-nav.next { right: -5.2rem; }
}
@media (max-width: 599px) { .hm-pager > .hm-nav { top: 9rem; width: 2.8rem; height: 2.8rem; font-size: 1.8rem; } .hm-pager > .hm-nav.prev { left: -.5rem; } .hm-pager > .hm-nav.next { right: -.5rem; } }
@media (min-width: 1500px) { .hm-duo:has(.hm-pager) { overflow: visible; } }

/* 1.6.4: Trang chi tiết lễ / giỗ theo hình mẫu (lớp .gct-page; ảnh nền assets/img/gio/ct-dinh.jpg) */
.gct-page .gi { display: inline-flex; flex: none; width: 1.25rem; height: 1.25rem; }
.gct-page .gi svg { width: 100%; height: 100%; }
.gct-page .gi.red { color: #c8261f; }
.gct-back.btn { margin-bottom: .5rem; }
.gct-page .gpg-bt1 .gold { color: #ffd463; }
/* bộ ảnh */
.gct-gal { position: relative; overflow: hidden; height: clamp(13rem, 22vw, 17rem); margin-bottom: 1.1rem; border-radius: 20px; border: 2px solid #e6b155;
  background: #3a1a0c; box-shadow: 0 4px 14px rgba(120,20,10,.22); }
.gct-bg { position: absolute; inset: -30px; background: center / cover no-repeat; filter: blur(22px) brightness(.62) saturate(1.1); }
.gct-img { position: relative; z-index: 1; display: block; height: 100%; max-width: 100%; margin: 0 auto; object-fit: contain; cursor: zoom-in; }
.gct-sen { position: absolute; z-index: 2; bottom: -.6rem; width: 7rem; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.gct-sen.a { left: -.4rem; } .gct-sen.b { right: -.4rem; transform: scaleX(-1); }
.gct-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; padding: 0 0 .15rem; border: 0; border-radius: 50%;
  background: #fffaf0; color: #a3141a; font-size: 2rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.gct-nav.prev { left: 1rem; } .gct-nav.next { right: 1rem; }
.gct-dots { position: absolute; z-index: 3; left: 0; right: 0; bottom: .7rem; display: flex; justify-content: center; gap: .45rem; }
.gct-dots button { width: .8rem; height: .8rem; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.75); cursor: pointer; }
.gct-dots button.on { background: #d1141b; box-shadow: 0 0 0 2px #fff; }
/* khung thông tin */
.gct-card { position: relative; margin-top: 1.6rem; padding: 1.3rem 1.6rem 1.2rem; border: 2px solid #ecc874; border-radius: 0 20px 20px 20px;
  background: linear-gradient(90deg, #fffaf0 0, #fff6e4 55%, rgba(255,246,228,.6)); box-shadow: 0 4px 14px rgba(150,90,20,.14); }
.gct-card::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: min(46%, 26rem); border-radius: 0 18px 18px 0; pointer-events: none;
  background: url("../img/gio/ct-dinh.jpg") right top / cover no-repeat; opacity: .75; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%); mask-image: linear-gradient(90deg, transparent 0, #000 45%); }
.gct-card > * { position: relative; z-index: 1; }
.gct-tab { position: absolute; z-index: 2; top: -1.55rem; left: -2px; display: inline-flex; align-items: center; gap: .55rem; height: 2.9rem; padding: 0 2.6rem 0 1.1rem;
  border-radius: 18px 22px 0 0; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff3dc; font-family: var(--gp-serif); font-size: 1.15rem; font-weight: 700;
  clip-path: polygon(0 0, calc(100% - 1.4rem) 0, 100% 100%, 0 100%); box-shadow: inset 0 -2px 0 #f1c35e; }
.gct-tab img { width: 2.1rem; height: auto; filter: sepia(1) saturate(4) hue-rotate(-10deg) brightness(1.25); }
.gct-card.m-to .gct-tab { background: linear-gradient(180deg, #d42a22, #7a0c10); color: #ffd463; }
.gct-card.m-thuong .gct-tab { background: linear-gradient(180deg, #2f7ab8, #1d5d8f); }
.gct-title { margin: 1.2rem 0 .25rem; font-family: var(--gp-serif); color: #a3141a; font-size: 1.85rem; line-height: 1.25; max-width: 62%; }
.gct-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; color: #3a2a1a; }
.gct-sub .views { font-size: 1rem; color: #3a2a1a; }
.gct-chip { padding: .1rem .6rem; border-radius: 999px; background: #fdf0d2; border: 1px solid #ecc874; font-size: .85rem; color: #5a3a14; }
.gct-chip.cay { background: #edf7e6; border-color: #9cc77a; color: #23510f; }
.gct-card .muc-ticks { margin: .7rem 0 .2rem; gap: .5rem; }
.gct-card .muc-tick { min-height: 2.5rem; padding: .2rem 1rem .2rem .55rem; border-radius: 999px; border: 1.5px solid #e2cfa2; background: #fffdf8; color: #2a1a0c; font-weight: 600; }
.gct-card .muc-tick .box { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid #3a2a1a; background: #fff; color: #3a2a1a; font-size: .8rem; display: inline-grid; place-items: center; }
.gct-card .muc-tick.on { background: #e9f7e2; border-color: #4f9a34; color: #1f5a10; }
.gct-card .muc-tick.on .box { background: #2f9b2a; border-color: #2f9b2a; color: #fff; }
.gct-when { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 0; margin: .9rem 0 .2rem; padding: .7rem 0; border-top: 1px solid #f0dfb8; border-bottom: 1px solid #f0dfb8; max-width: 62%; }
.gct-wc { display: flex; align-items: center; gap: .7rem; padding-right: 1.6rem; }
.gct-wc + .gct-wc { padding-left: 1.6rem; border-left: 2px solid #e6a0a0; }
.gct-wc .gi { width: 2rem; height: 2rem; }
.gct-wc small { display: block; color: #4a3a2a; font-size: .95rem; }
.gct-wc b { font-size: 1.12rem; color: #2a1a0c; }
.gct-left { display: flex; align-items: center; gap: .45rem; margin-top: .8rem; font-family: var(--gp-serif); font-size: 1.2rem; font-weight: 700; color: #2a1a0c; }
.gct-left .gi { width: 1.6rem; height: 1.6rem; }
.gct-card .cd.big { gap: .8rem; max-width: 36rem; margin: .4rem 0 .9rem .5rem; }
.gct-card .cd.big .cd-u { min-width: 5.6rem; max-width: 8rem; padding: .35rem .4rem .45rem; border-radius: 12px; border: 2px solid #ecc874;
  background: linear-gradient(180deg, #d42a22, #8e0d12); color: #fff; box-shadow: 0 3px 8px rgba(120,20,10,.3); }
.gct-card .cd.big .cd-u b { font-family: var(--gp-serif); font-size: 2.3rem; line-height: 1.05; }
.gct-card .cd.big .cd-u small { font-size: 1rem; opacity: 1; }
.gct-line { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; margin-top: .3rem; font-size: 1.08rem; color: #2a1a0c; }
.gct-line > .gi { width: 1.4rem; height: 1.4rem; }
.gct-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem 1rem; border-radius: 999px; border: 1.5px solid #c98a2a; background: #fffdf8; color: #2a1a0c; font-weight: 700; text-decoration: none; }
.gct-pill:hover { background: #fff3dc; }
.gct-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.6rem; margin-top: .55rem; font-size: 1.05rem; color: #2a1a0c; }
.gct-mi { display: inline-flex; align-items: center; gap: .45rem; color: #2a1a0c; text-decoration: none; }
.gct-mi .gi { width: 1.3rem; height: 1.3rem; }
a.gct-link { color: #c8121b; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.gct-btns { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.gct-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.9rem; padding: .3rem 1.5rem; border-radius: 999px; border: 1.5px solid #e2c48a; background: #fffdf8;
  color: #2a1a0c; font-weight: 700; text-decoration: none; box-shadow: 0 2px 5px rgba(150,90,20,.12); }
.gct-btn:hover { background: #fff3dc; }
.gct-btn.main { border-color: #7a0c10; background: linear-gradient(180deg, #a3141a, #7a0c10); color: #fff; }
.gct-btn .gi { width: 1.2rem; height: 1.2rem; }
.gct-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .9rem; padding-right: 5rem; color: #6a5440; }
.gct-card-sen { position: absolute !important; z-index: 1; right: -.6rem; bottom: -.9rem; width: 6.5rem; pointer-events: none; }
.gct-card.m-to { border-color: #e2a84a; }
/* Ban trị sự | Chương trình tổ chức */
.gct-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 1rem; margin-top: 1.2rem; }
.gct-row.one { grid-template-columns: 1fr; }
.gct-box { position: relative; padding: .9rem 1.1rem 1.1rem; border: 2px solid #ecc874; border-radius: 16px; background: linear-gradient(180deg, #fffaf0, #fff5e2);
  box-shadow: 0 3px 10px rgba(150,90,20,.12); }
.gct-page > .gct-box { margin-top: 1rem; }
.gct-box-h { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 .7rem; padding: .35rem 1.6rem .35rem .8rem; border-radius: 999px;
  background: linear-gradient(90deg, #fde9bd, rgba(253,233,189,0)); font-family: var(--gp-serif); font-size: 1.25rem; color: #5a2a10; }
.gct-box-h .gi { width: 1.6rem; height: 1.6rem; }
.gct-box-b { color: #2a1a0c; line-height: 1.6; }
.gct-box-b p { margin: 0 0 .3rem; }
.gct-box.tc .gct-box-b { column-count: 2; column-gap: 2rem; }
.gct-box.tc .gct-box-b p { break-inside: avoid; }
.gct-person { display: flex; align-items: center; gap: .8rem; width: 100%; margin-top: 1rem; padding: .7rem 1rem; border: 2px solid #ecc874; border-radius: 16px;
  background: #fffaf0; text-align: left; cursor: pointer; font: inherit; color: #2a1a0c; }
.gct-person b { display: block; color: #a3141a; font-size: 1.1rem; }
.gct-person small { color: #6a5440; }
.gct-note { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; color: #6a5440; }
.gct-admin { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
@media (max-width: 899px) {
  .gct-title, .gct-when { max-width: none; }
  .gct-card::before { width: 100%; opacity: .25; }
  .gct-row { grid-template-columns: 1fr; }
  .gct-box.tc .gct-box-b { column-count: 1; }
}
@media (max-width: 599px) {
  .gct-gal { height: 13rem; border-radius: 16px; }
  .gct-sen { width: 4.5rem; }
  .gct-nav { width: 2.5rem; height: 2.5rem; font-size: 1.6rem; } .gct-nav.prev { left: .5rem; } .gct-nav.next { right: .5rem; }
  .gct-card { padding: 1.1rem .9rem 1rem; }
  .gct-tab { font-size: 1rem; height: 2.5rem; top: -1.3rem; }
  .gct-title { font-size: 1.4rem; margin-top: 1rem; }
  .gct-wc { padding-right: .8rem; } .gct-wc + .gct-wc { padding-left: .8rem; }
  .gct-wc b { font-size: 1rem; }
  .gct-card .cd.big { gap: .4rem; margin-left: 0; }
  .gct-card .cd.big .cd-u { min-width: 0; }
  .gct-card .cd.big .cd-u b { font-size: 1.7rem; }
  .gct-btn { flex: 1 1 auto; justify-content: center; padding: .3rem 1rem; }
  .gct-share { padding-right: 3rem; }
  .gct-card-sen { width: 4.5rem; }
}
/* 1.6.4b: dòng địa chỉ – icon luôn cùng dòng với chữ */
.gct-line { display: grid; grid-template-columns: auto minmax(0,max-content) auto; justify-content: start; }
.gct-line { align-items: center; }
.gct-line > span { min-width: 0; }
@media (max-width: 640px) {
  .gct-line { grid-template-columns: auto 1fr; }
  .gct-line > .gi { align-self: start; margin-top: .3rem; }
  .gct-line > .gct-pill { grid-column: 2; justify-self: start; }
  .gct-meta { gap: .4rem 1rem; }
}
/* 1.6.5: gắn node người mất vào lễ / giỗ; lễ - giỗ của nhánh ở Thông tin dòng họ */
.evn-box { border: 1px dashed #d9b46a; border-radius: 14px; padding: .7rem .8rem .2rem; background: #fffaf0; margin: .3rem 0 .8rem; }
.evn-chon { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .2rem 0 .45rem; }
.evn-tag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .2rem; padding: .35rem .8rem; border-radius: 999px; background: #e7f6e4; border: 1px solid #93cf8b; color: #1f4a1b; }
.evn-tag small { color: #3f6b39; }
.evn-kq { display: flex; flex-direction: column; gap: .3rem; margin-top: .35rem; max-height: 16rem; overflow: auto; }
.evn-item { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; padding: .45rem .7rem; border: 1px solid var(--line, #e5d6b8); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.evn-item:hover, .evn-item:focus-visible { border-color: #c98a2a; background: #fff6e3; }
.evn-item small { color: #7a6650; }
.rec-tools { display: flex; justify-content: flex-end; margin-bottom: .6rem; }
.rec-le { border-color: #e2b75a; background: linear-gradient(180deg, #fff8e8, #fffdf8); }
.rec-le h3 { color: #a3161c; }
.rec-le .rec-name { font-weight: 700; color: #a3161c; text-decoration: none; text-align: left; }
.rec-le a.rec-name:hover { text-decoration: underline; }
/* 1.6.6: Lễ - Giỗ của nhánh: một danh sách chung, ô ngày cùng bề rộng */
.rec-le .rec-date { min-width: 4.3rem; box-sizing: border-box; text-align: center; }
.rec-le .rec-main { flex: 1 1 14rem; min-width: 0; }
/* 1.6.7: số thứ tự, nút chia sẻ từng ngày / cả danh sách Lễ - Giỗ */
.rec-le .rec-stt { flex: 0 0 auto; min-width: 1.9rem; height: 1.9rem; padding: 0 .3rem; box-sizing: border-box; border-radius: 999px; display: inline-grid; place-items: center; background: #a3161c; color: #ffe9a8; font-weight: 800; font-size: .9rem; }
.rec-le .rec-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.rec-tools { gap: .5rem; flex-wrap: wrap; }
.rec-tools .btn.zalo { background: #0068ff; color: #fff; border-color: #0068ff; }
@media (max-width: 640px) { .rec-le .rec-acts { margin-left: 0; width: 100%; justify-content: flex-end; } }
@media (max-width: 640px) {
  .rec-le .rec-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: .5rem .55rem; }
  .rec-le .rec-date { min-width: 3.6rem; }
  .rec-le .rec-main { grid-column: 3; }
  .rec-le .rec-row > .chip { grid-column: 1 / 3; justify-self: start; white-space: nowrap; }
  .rec-le .rec-acts { grid-column: 3; width: auto; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .rec-le .rec-acts { flex-wrap: nowrap; }
  .rec-le .rec-share .t { display: none; }
  .rec-le .rec-share { padding-inline: .7rem; }
}
@media (max-width: 640px) {
  .rec-le .rec-acts .btn { white-space: nowrap; padding: .35rem .6rem; min-height: 2.4rem; }
  .rec-le .rec-acts { gap: .3rem; }
}
/* 1.6.8: lễ / giỗ có gắn node: hiện node ngay trong dòng */
.rec-le .rec-node { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .45rem; margin: .15rem 0; }
.rec-le .rec-node-l { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: #3f7a37; border-radius: 6px; padding: .05rem .4rem; }
.rec-le .rec-node-b { font: inherit; font-weight: 700; color: #1f4a1b; background: #e7f6e4; border: 1px solid #93cf8b; border-radius: 999px; padding: .1rem .7rem; cursor: pointer; }
.rec-le .rec-node-b:hover, .rec-le .rec-node-b:focus-visible { background: #d3efcd; }
.rec-le .rec-node small { color: #5d6b55; }
/* 1.6.9: ô "Theo dòng thời gian" kiểu đỏ – vàng theo mẫu */
.kp:not(.kp-an) { background: #fffaf0; border: 2px solid #e9b34f; border-radius: 16px; box-shadow: 0 14px 38px rgba(110, 40, 5, .28), 0 0 0 4px rgba(233, 179, 79, .18); }
.kp-head { background: linear-gradient(180deg, #c4161c, #9e0f15); padding: .65rem .7rem .65rem .85rem; border-bottom: 2px solid #e9b34f; }
.kp-ico { width: 2.35rem; height: 2.35rem; flex: none; display: inline-grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .12); border: 1.5px solid rgba(255, 233, 180, .85); color: #fff; }
.kp-ico .ic { width: 1.3rem; height: 1.3rem; }
.kp-title b { font-size: 1.12rem; letter-spacing: .01em; }
.kp-title small { opacity: .92; color: #ffe3b3; }
.kp-btn { width: 2.35rem; height: 2.35rem; border-radius: 9px; background: rgba(0, 0, 0, .12); border: 1.5px solid #f2c46a; color: #fff6dc; }
.kp-btn:hover, .kp-btn:focus-visible { background: rgba(255, 255, 255, .16); }
.kp-list { overflow-x: hidden; padding: .2rem .7rem .8rem .55rem; background: #fffaf0; }
.kp-year { background: #fffaf0; padding: .55rem 0 .45rem; margin-left: -.55rem; margin-right: 0; color: #3b1c08; font-size: 1rem; }
.kp-year span { display: inline-block; padding: .3rem 1.2rem .3rem .9rem; border-radius: 0 999px 999px 0; background: linear-gradient(90deg, #f7cf6c, #ffe9b0 70%, #fff3d2); box-shadow: inset 0 -2px 0 rgba(176, 112, 20, .25); font-weight: 800; }
.kp-item { box-sizing: border-box; width: calc(100% - .75rem); border-left: 2.5px solid #b3161d; border-radius: 0 12px 12px 0; margin-left: .75rem; padding: .6rem .3rem .75rem 1.25rem; gap: .6rem; }
.kp-item + .kp-item::before { content: ''; position: absolute; left: 1.25rem; right: .3rem; top: 0; border-top: 1px dashed #ecd6ae; }
.kp-item:hover, .kp-item:focus-visible, .kp-item.on { background: #fdeccd; }
.kp-dot { left: -.62rem; top: .85rem; width: 1.05rem; height: 1.05rem; background: #fff; border: 2.5px solid #b3161d; box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 10px #8e1015; }
.kp-it small { color: #7d6a55; }
.kp-it b { color: #1e140c; font-size: 1rem; overflow-wrap: anywhere; }
.kp-sum { color: #6e5d4a; overflow-wrap: anywhere; }
.kp-item img { width: 4.6rem; height: 3.3rem; border-radius: 9px; border: 1.5px solid #f0d9ae; box-shadow: 0 2px 6px rgba(80, 40, 10, .15); }
.kp-foot { background: #fffaf0; border-top: 1.5px solid #f0d9ae; padding: .55rem 1rem; }
.kp-foot a { color: #b3161d; font-weight: 600; text-decoration: none; }
.kp-foot a span { text-decoration: underline; text-underline-offset: 3px; }
.kp-pill { background: linear-gradient(180deg, #c4161c, #9e0f15); border: 2px solid #e9b34f; }
@media (max-width: 599px) { .kp-title b { font-size: 1rem; white-space: nowrap; } .kp-ico { width: 2.1rem; height: 2.1rem; } .kp-btn { width: 2.2rem; height: 2.2rem; } }
/* 1.7.0: xuất ảnh JPG danh sách Lễ - Giỗ */
.lgi-img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(60, 30, 5, .15); max-height: 62vh; object-fit: contain; background: #fff8ea; }
.lgi-foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; width: 100%; }
.lgi-foot .btn.zalo { background: #0068ff; color: #fff; border-color: #0068ff; }

/* ===== 1.7.1: Nhắc lịch ===== */
.nl-btn { display: inline-flex; align-items: center; gap: .35rem; border: 1.5px solid #e0a43a; background: #fff6df; color: #8a1c12; font-weight: 700; white-space: nowrap; }
.nl-btn:hover { background: #ffe9b8; }
.nl-btn .ic { width: 1.05rem; height: 1.05rem; }
.gc-row2 { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; margin-top: .45rem; }
.gc-row2 .muc-ticks { margin-top: 0 !important; }
.gio-page .gc .gc-row2 { clear: both; }
.gct-btn.nl-btn { color: #8a1c12; border-color: #e0a43a; background: #fff6df; font-size: inherit; }
.nl-box { display: grid; gap: .9rem; }
.nl-head { display: grid; gap: .2rem; padding: .7rem .9rem; border-radius: 12px; background: #fff7e6; border: 1px solid #f0d49a; }
.nl-head b { color: #9b1b13; font-size: 1.1em; }
.nl-head small { color: #6b5440; }
.nl-opts { display: grid; gap: .6rem; }
.nl-opt { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: 14px; border: 1.5px solid #e2c48a; background: #fffdf8; color: inherit; text-decoration: none; }
.nl-opt:hover, .nl-opt:focus-visible { background: #fff3dc; border-color: #c8862a; }
.nl-opt > span:last-child { display: grid; gap: .15rem; }
.nl-opt b { color: #7a0c10; }
.nl-opt small { color: #6b5440; }
.nl-ic { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: linear-gradient(180deg, #a3141a, #7a0c10); color: #ffd98a; font-weight: 800; font-size: 1.2rem; }
.nl-ic .ic { width: 1.4rem; height: 1.4rem; }
.nl-ic.g { background: #fff; color: #1a73e8; border: 1.5px solid #c9d7f5; font-family: Arial, sans-serif; }
.nl-note { display: flex; gap: .4rem; align-items: flex-start; margin: 0; font-size: .9em; }
@media (max-width: 640px) { .rec-le .rec-nl .t { display: none; } .rec-le .rec-nl { padding-inline: .7rem; } }
@media (max-width: 640px) {
  /* 1.7.1: 3 nút (Bản tin, Nhắc lịch, Chia sẻ) — "Còn N ngày" bên trái, nút bên phải, cùng một hàng dưới */
  .rec-le .rec-row > .chip { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
  .rec-le .rec-acts { grid-row: 2; grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 640px) {
  .rec-le .rec-row > .chip { font-size: .82rem; padding: .2rem .5rem; }
  .rec-le .rec-acts .btn { padding-inline: .5rem; }
}
@media (max-width: 360px) { .rec-le .rec-row > .chip { grid-row: 3; } }
@media (max-width: 640px) { .rec-le .rec-acts { gap: .25rem; } .rec-le .rec-acts .btn { padding-inline: .45rem; } .rec-le .rec-row > .chip { padding-inline: .4rem; } }

/* ===== 1.7.2: Thông tin dòng họ — khối đầu, hàng tab đỏ – vàng; Lịch sử chi - họ theo mẫu ===== */
.cat-hero { margin: .2rem 0 .9rem; }
.cat-hero .hm-pagoda { opacity: .8; }
.cat-bar { --cb-red: #a3141a; gap: .6rem; margin: .1rem 0 1.1rem; }
.cat-btn { min-height: 3.1rem; padding: .35rem 1.15rem; border-radius: 999px; border: 1.5px solid #e9c77e; color: #7a1a10;
  background: linear-gradient(180deg, #fffdf6, #fbefd2); box-shadow: 0 2px 6px rgba(150,90,20,.14); font-weight: 700; }
.cat-btn:hover { border-color: #c98a2a; background: #fff3dc; }
.cat-btn.on { background: linear-gradient(180deg, #c8261f, #8e0d12); border-color: #7a0c10; color: #fff; box-shadow: 0 4px 10px rgba(120,20,10,.32); }
.cat-ic { display: inline-grid; width: 1.45rem; height: 1.45rem; color: #a3141a; font-size: 1rem; }
.cat-ic svg { width: 100%; height: 100%; }
.cat-btn.on .cat-ic { color: #fff; --ci-f: #e6b155; }

.cs-page { --cs-red: #a3141a; --cs-serif: "Noto Serif", "Times New Roman", Georgia, serif; position: relative; max-width: none; }
.cs-i { display: inline-grid; flex: none; }
.cs-i svg { width: 100%; height: 100%; }
.cs-head { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 1rem; }
.cs-h { display: flex; align-items: center; gap: .7rem; margin: 0; color: var(--cs-red); font-size: 1.85rem; font-weight: 700; line-height: 1.2; }
.cs-h .cs-i.book { width: 3.2rem; height: 2.7rem; }
.cs-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cs-q.blog-q { min-width: 14rem; max-width: 17rem; min-height: 2.9rem; border: 1.5px solid #e2c48a; border-radius: 12px; background: #fffdf8; }
.cs-new.btn { min-height: 2.9rem; padding: .3rem 1.4rem; border-radius: 12px; border: 1.5px solid #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-size: 1.1rem; font-weight: 800; box-shadow: 0 4px 10px rgba(120,20,10,.3); }
.cs-intro { position: relative; z-index: 1; margin: .7rem 0 1.1rem; padding: .15rem 0 .15rem .8rem; border-left: 3.5px solid #e0a43a; color: #2c1e12; font-size: 1.02rem; }
.cs-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.2rem; }
.cs-grid > .empty { grid-column: 1 / -1; }
.cs-card { position: relative; display: flex; flex-direction: column; align-items: stretch; min-height: 21rem; overflow: hidden; cursor: pointer;
  border: 2px solid #ecc874; border-radius: 18px; background: linear-gradient(180deg, #fffaf0, #fdf3df); box-shadow: 0 5px 16px rgba(150,90,20,.18); transition: transform .15s, box-shadow .15s; }
.cs-card:hover, .cs-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(150,90,20,.26); outline: none; border-color: #d9a441; }
.cs-scroll { display: block; width: 4.8rem; height: 4.8rem; margin: 1.3rem auto .2rem; object-fit: contain; }
.cs-cover { position: relative; margin: .6rem .6rem 0; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 8; border: 1.5px solid #f0d596; }
.cs-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-n { position: absolute; right: .5rem; bottom: .5rem; padding: .1rem .6rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; }
.cs-body { position: relative; z-index: 1; display: grid; gap: .45rem; padding: .5rem 1.4rem .6rem; }
.cs-pin { justify-self: start; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .8rem; border-radius: 999px; background: #fbe3cf; color: #b3121b; font-weight: 700; font-size: .95rem; }
.cs-pin .cs-i { width: 1.05rem; height: 1.05rem; }
.cs-t { margin: .1rem 0 0; text-align: center; color: var(--cs-red); font-size: 1.45rem; line-height: 1.3; font-weight: 800; }
.cs-meta { display: flex; align-items: center; gap: .45rem; color: #2c1e12; font-size: .98rem; }
.cs-meta .cs-i { width: 1.2rem; height: 1.2rem; }
.cs-sum { margin: .25rem 0 0; color: #3a2a1a; font-size: 1.02rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cs-land { flex: none; height: 7.2rem; margin-top: auto; background: url("../img/cs/nui.jpg") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 35%); mask-image: linear-gradient(180deg, transparent 0, #000 35%); }
.cs-empty { text-align: center; }
.cs-foot { position: relative; z-index: 0; display: block; width: 100%; margin: 1.6rem 0 0; aspect-ratio: 1536 / 184; background: url("../img/cs/chan.jpg") center bottom / 100% 100% no-repeat; }
@media (min-width: 1250px) {
  .cs-page::before { content: ""; position: absolute; z-index: 0; right: 0; top: 9rem; width: 24rem; height: 31rem; pointer-events: none;
    background: url("../img/cs/dinh.jpg") right top / 100% auto no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%), linear-gradient(180deg, transparent 0, #000 8%, #000 85%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 22%), linear-gradient(180deg, transparent 0, #000 8%, #000 85%, transparent 100%);
    mask-composite: intersect; }
  .cs-grid { margin-right: 22rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
}
@media (max-width: 700px) {
  .cs-h { font-size: 1.35rem; }
  .cs-h .cs-i.book { width: 2.4rem; height: 2rem; }
  .cs-tools, .cs-q.blog-q { flex: 1 1 auto; max-width: none; }
  .cs-t { font-size: 1.25rem; }
  .cs-card { min-height: 0; }
}

/* Cửa sổ đọc bài */
.modal-wrap.cs-read-wrap { padding: .8rem; }
.modal.cs-read { max-width: min(1240px, 96vw) !important; height: min(92dvh, 56rem); display: flex; flex-direction: column; overflow: hidden;
  border: 2px solid #ecc874; border-radius: 20px; background: linear-gradient(180deg, #fffaf0, #fdf4e2); }
.cs-read .modal-head { flex: none; position: relative; padding: .75rem 1rem .75rem 1.2rem; border-bottom: 0; color: #fff;
  background: linear-gradient(100deg, #8e0d12 0%, #b3121b 55%, #c8261f 72%, rgba(200,38,31,.0) 92%), #fdf3df; }
.cs-read .modal-head h2 { display: flex; align-items: center; gap: .6rem; color: #fff; font-size: 1.3rem; font-weight: 800; padding-right: 1rem; }
.cs-read .modal-head h2 .cs-i.book { width: 2.3rem; height: 1.9rem; }
.cs-read .close-btn { flex: none; background: #fbefd8; color: #3a1d0b; border: 1.5px solid #e9c77e; border-radius: 12px; font-weight: 800; }
.cs-read .modal-body { flex: 1; min-height: 0; padding: 0; }
.cs-read-in { height: 100%; display: grid; grid-template-columns: min(25rem, 32%) 1fr; }
.cs-r-side { overflow: auto; padding: 1rem 1rem 1.2rem 1.4rem; border-right: 1.5px solid #f0dcae; background: rgba(255,250,238,.85); }
.cs-toc { display: grid; gap: .55rem; }
.cs-toc-g { display: grid; gap: .1rem; }
.cs-toc button { all: unset; cursor: pointer; display: block; border-radius: 6px; padding: .05rem .3rem; }
.cs-toc button:hover, .cs-toc button:focus-visible { background: #fdebc4; }
.cs-toc .cs-toc-h { color: #a3141a; font-weight: 800; font-size: 1.04rem; }
.cs-toc .cs-toc-li { padding-left: 1.4rem; color: #2c1e12; font-size: .98rem; }
.cs-toc-info { display: grid; gap: .45rem; color: #3a2a1a; }
.cs-toc-info b { color: #a3141a; }
.cs-toc-info .cs-i { width: 1.1rem; height: 1.1rem; margin-right: .35rem; vertical-align: -.15rem; }
.cs-r-main { position: relative; overflow: auto; padding: 1rem 1.6rem 1.4rem; scroll-padding-top: 1rem;
}
.cs-r-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem 1.6rem .35rem .8rem; color: #fff; font-weight: 800; font-size: 1.12rem;
  background: linear-gradient(180deg, #c8261f, #8e0d12); clip-path: polygon(0 0, calc(100% - .9rem) 0, 100% 50%, calc(100% - .9rem) 100%, 0 100%); border-radius: 10px 0 0 10px; }
.cs-r-tab img { width: 1.6rem; height: 1.6rem; object-fit: contain; }
.cs-r-title { margin: .9rem 0 .2rem; text-align: center; color: #a3141a; font-size: 1.45rem; font-weight: 800; line-height: 1.3; }
.cs-r-div { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: 0 auto .8rem; max-width: 34rem; }
.cs-r-div::before, .cs-r-div::after { content: ""; flex: 1; height: 1.5px; background: linear-gradient(90deg, transparent, #c98a2a); }
.cs-r-div::after { background: linear-gradient(90deg, #c98a2a, transparent); }
.cs-r-div img { width: 2rem; height: 2rem; object-fit: contain; }
.cs-r-text { font-size: 1.06rem; line-height: 1.75; color: #24180e; }
.cs-r-text p { margin: .3rem 0 .7rem; }
.cs-r-h { margin: 1rem 0 .3rem; color: #a3141a; font-size: 1.2rem; font-weight: 800; scroll-margin-top: .8rem; }
.cs-r-ul { list-style: none; margin: 0 0 .5rem; padding-left: 1.6rem; }
.cs-r-ul li { position: relative; padding: .05rem 0; scroll-margin-top: .8rem; }
.cs-r-ul li::before { content: "-"; position: absolute; left: -.9rem; }
.cs-r-text .flash { animation: csflash 1.4s ease; border-radius: 6px; }
@keyframes csflash { 0%, 40% { background: #ffe39a; } 100% { background: transparent; } }
.cs-read .modal-foot { flex: none; position: static; display: flex; gap: .7rem; padding: .8rem 1.2rem .8rem calc(min(25rem, 32%) + 1.6rem); background: #fdf4e2; border-top: 1.5px solid #f0dcae; }
.cs-read .modal-foot .btn { flex: 0 0 auto; }
.cs-read .modal-foot .btn.main { flex: 1 1 auto; }
.cs-fb.btn { min-height: 2.9rem; padding: .3rem 1.6rem; border-radius: 12px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #3a1d0b; font-weight: 800; font-size: 1.05rem; }
.cs-fb.btn:hover { background: #fff3dc; }
.cs-fb .ic, .cs-fb .cs-i { width: 1.2rem; height: 1.2rem; }
.cs-fb.del { border-color: #e3707a; color: #c8121b; }
.cs-fb.main { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; box-shadow: 0 4px 10px rgba(120,20,10,.3); }
@media (max-width: 899px) {
  .modal.cs-read { height: 94dvh; }
  .cs-read-in { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cs-r-side { max-height: 30vh; border-right: 0; border-bottom: 1.5px solid #f0dcae; padding: .7rem 1rem; }
  .cs-read-in.no-toc .cs-r-side { display: none; }
  .cs-r-main { padding: .8rem 1rem 1rem; background-size: 14rem auto; }
  .cs-read .modal-foot { flex-wrap: wrap; padding: .6rem .8rem; }
  .cs-read .modal-foot .btn { flex: 1 1 auto; padding: .3rem .8rem; }
  .cs-read .modal-head h2 { font-size: 1.08rem; }
}
@media (max-width: 899px) {
  .cs-read .modal-head { background: linear-gradient(100deg, #8e0d12, #b3121b 70%, #c8261f); }
  .cs-read .modal-head h2 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cs-read .modal-head h2 .cs-i.book { display: none; }
}

/* ===== 1.7.3: Tiêu điểm + Theo đời kiểu đỏ – vàng theo mẫu ===== */
/* nhãn đỏ dạng dải (dùng chung) */
.fx-rib, .gs-rib { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 -1px; min-height: 2.9rem; padding: .35rem 2.6rem .35rem 1.1rem;
  color: #fff; font-size: 1.15rem; font-weight: 700; line-height: 1.25; border-radius: 16px 0 0 0;
  background: linear-gradient(180deg, #c8261f, #8e0d12); clip-path: polygon(0 0, calc(100% - 2.1rem) 0, 100% 100%, 0 100%); box-shadow: 0 2px 0 #e6b155 inset; }
.fx-rib .fx-i, .gs-rib .gs-i { width: 1.9rem; height: 1.9rem; color: #ffd463; --fx-f: #ffd463; }
.fx-i, .gs-i { display: inline-grid; flex: none; }
.fx-i svg, .gs-i svg { width: 100%; height: 100%; }
.gs-rib small { font-weight: 500; font-size: .85em; opacity: .95; }
.fx-box, .gs-box { position: relative; border: 1.5px solid #ecc874; border-radius: 0 18px 18px 18px; background: linear-gradient(180deg, #fffaf0, #fdf4e2); padding: 1rem 1.1rem; box-shadow: 0 4px 14px rgba(150,90,20,.12); }

/* Tiêu điểm */
.focus.fx { max-width: 76rem; padding: 1rem 1rem 0; position: relative; isolation: isolate; }
.focus.fx::before { content: ""; position: absolute; z-index: -1; right: 0; top: 0; width: min(62rem, 72%); aspect-ratio: 976 / 118; pointer-events: none;
  background: url("../img/fx/tren.jpg") right top / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%), linear-gradient(180deg, #000 70%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 30%), linear-gradient(180deg, #000 70%, transparent); mask-composite: intersect; }
.fx-pill { display: inline-flex; align-items: center; gap: .6rem; margin: .2rem 0 1rem; padding: .55rem 1.2rem; border-radius: 999px; background: #fffaf0; border: 1.5px solid #f0d596; color: #3a2a1a; font-size: 1.02rem; box-shadow: 0 2px 8px rgba(150,90,20,.12); }
.fx-pill .fx-i { width: 1.4rem; height: 1.4rem; color: #c8121b; }
.fcenter.fx-center { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.6rem; padding: 1.3rem 1.6rem; margin-bottom: 1.4rem; min-height: 11rem;
  border: 2px solid #c8261f; border-radius: 22px; background: linear-gradient(90deg, #fff7e6 0%, #fdeccb 45%, #fbe6bf 100%); box-shadow: 0 6px 18px rgba(150,40,20,.16); }
.fx-center::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: min(36rem, 52%); pointer-events: none;
  background: url("../img/fx/canh.jpg") right center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 35%); mask-image: linear-gradient(90deg, transparent 0, #000 35%); }
.fx-center.female { border-color: #5fa858; }
.fx-av { position: relative; z-index: 1; flex: none; padding-right: 1.6rem; border-right: 2px solid #c98a2a; }
.fx-av .avatar.lg { width: 8.5rem; height: 8.5rem; font-size: 3.6rem; font-family: "Noto Serif", Georgia, serif; font-weight: 800; color: #7a1a10;
  background: radial-gradient(circle at 40% 35%, #fff8e6, #f6dfae); border: 3px solid #f0d596; box-shadow: 0 0 0 6px rgba(240,213,150,.35); }
.fx-center.female .fx-av .avatar.lg { color: #1f4a1b; background: radial-gradient(circle at 40% 35%, #f3fbf0, #d5efcf); }
.fx-who { position: relative; z-index: 1; min-width: 0; display: grid; gap: .45rem; }
.fx-who h2 { margin: 0; font-family: "Noto Serif", "Times New Roman", Georgia, serif; color: #a3141a; font-size: 2.3rem; font-weight: 800; line-height: 1.15; }
.fx-meta { display: flex; align-items: center; gap: .55rem; color: #2c1e12; font-size: 1.12rem; }
.fx-meta .fx-i { width: 1.4rem; height: 1.4rem; color: #b3121b; }
.fx-sp { color: #3a2a1a; }
.fx-btns { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .4rem; }
.fx-b.btn { min-height: 3rem; padding: .3rem 1.6rem; border-radius: 14px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #7a1a10; font-weight: 800; font-size: 1.05rem; }
.fx-b.btn:hover { background: #fff3dc; }
.fx-b.main { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; box-shadow: 0 4px 10px rgba(120,20,10,.3); }
.fx-sec { margin: 0 0 1.3rem; }
.fx-sec .fcards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .9rem; }
.fx .fcard { min-height: 5.6rem; padding: .7rem 1rem; gap: .9rem; border: 1.5px dashed #e3b765; border-radius: 16px; background: #fffaf0; box-shadow: none; }
.fx .fcard:hover { border-color: #c98a2a; background: #fff3dc; }
.fx .fcard .avatar { width: 3.6rem; height: 3.6rem; font-size: 1.5rem; flex: none; font-family: "Noto Serif", Georgia, serif; font-weight: 800; color: #7a1a10; background: radial-gradient(circle at 40% 35%, #fff4dc, #f3d9a4); }
.fx .fcard b { font-family: "Noto Serif", "Times New Roman", Georgia, serif; color: #a3141a; font-size: 1.28rem; line-height: 1.25; }
.fx .fcard small { color: #2c1e12; font-size: .98rem; }
.fx .fcard.dead { border: 1.5px solid #bfb2a3; background: linear-gradient(180deg, #ece4dc, #e3d9ce); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.fx .fcard.female { background: #f1faee; border-color: #93cf8b; }
.fx .fcard.female b { color: #1f6a1b; }
.fx .fcard.female .avatar { color: #1f4a1b; background: radial-gradient(circle at 40% 35%, #f3fbf0, #d5efcf); }
.fx .fcard.female.dead { background: #dfe7dc; border-style: solid; }
.fx-down { text-align: center; color: #c98a2a; margin: -.6rem 0 .6rem; }
.fx-none { margin: 0; }
.fx-foot, .gs-foot { margin: 1rem -1rem 0; aspect-ratio: 1536 / 184; width: calc(100% + 2rem); background: url("../img/cs/chan.jpg") center bottom / 100% 100% no-repeat; }
.gs-foot { margin: 1.2rem 0 0; width: 100%; }
@media (max-width: 700px) {
  .focus.fx { padding: .6rem .6rem 0; }
  .focus.fx::before { width: 100%; }
  .fcenter.fx-center { flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1rem; }
  .fx-center::after { width: 100%; opacity: .35; }
  .fx-av { padding: 0; border: 0; }
  .fx-av .avatar.lg { width: 5.5rem; height: 5.5rem; font-size: 2.4rem; }
  .fx-who h2 { font-size: 1.7rem; }
  .fx-rib, .gs-rib { font-size: 1rem; padding-right: 2.2rem; }
  .fx-foot { margin: 1rem -.6rem 0; width: calc(100% + 1.2rem); }
}

/* Theo đời */
.gs-view { max-width: 96rem; }
.gs-sec { margin: 0 0 1.2rem; }
.gs-top { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 1300px) {
  .gs-top { grid-template-columns: 1fr 18rem; align-items: stretch; }
  .gs-art { border-radius: 0 0 0 40px; background: url("../img/fx/dinh.jpg") center top / cover no-repeat; margin-bottom: 1.2rem;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%), linear-gradient(180deg, #000 80%, transparent); -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 18%), linear-gradient(180deg, #000 80%, transparent); mask-composite: intersect; }
}
.gs-trees { gap: .55rem; }
.gs-chip { min-height: 2.6rem; padding: .3rem .9rem .3rem .6rem; border: 1.5px solid #ecc874; background: #fffdf8; color: #2c1e12; font-weight: 500; box-shadow: 0 1px 3px rgba(150,90,20,.1); }
.gs-chip:hover { border-color: #c98a2a; }
.gs-chip.on, .gs-chip:has(input:checked) { border-color: #c8261f; background: #fff1e6; color: #a3141a; font-weight: 700; }
.gs-chip input { accent-color: #c8121b; width: 1.2rem; height: 1.2rem; }
.gs-filters { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.gs-filters select { min-height: 2.9rem; border-radius: 12px; border: 1.5px solid #e2c48a; background: #fffdf8; padding: 0 .9rem; font-weight: 600; color: #2c1e12; }
.gs-doi { color: #a3141a !important; font-weight: 800 !important; font-size: 1.12rem; min-width: 12rem; border-color: #e2c48a !important; }
.gs-doiwrap { gap: .5rem; }
.gs-arrow { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 1.5px solid #e2c48a; background: #fffdf8; color: #c8121b; font-size: 1rem; cursor: pointer; }
.gs-arrow:hover:not(:disabled) { background: #fff1e6; border-color: #c8261f; }
.gs-arrow:disabled { opacity: .4; cursor: default; }
.gs-dr { display: inline-flex; align-items: center; gap: .45rem; color: #2c1e12; }
.gs-dr input { width: 1.2rem; height: 1.2rem; accent-color: #c8121b; }
.gs-note { display: flex; align-items: flex-start; gap: .45rem; margin: .7rem 0 0; color: #3a2a1a; font-size: .95rem; }
.gs-note .gs-i { width: 1.15rem; height: 1.15rem; margin-top: .15rem; }
.gs-sum { margin: 0; }
.gs-rib b { font-weight: 800; }
.gs-stats { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .8rem; }
.gs-stat { align-items: center; text-align: center; padding: .7rem .6rem; border: 1.5px solid #f0d596; border-radius: 14px; background: linear-gradient(180deg, #fffdf6, #fbefd2); box-shadow: 0 2px 6px rgba(150,90,20,.12); }
.gs-stat b { color: #a3141a; font-size: 1.75rem; font-weight: 800; }
.gs-stat span { color: #2c1e12; font-size: 1rem; }
.gs-pertree { gap: .6rem; margin: .9rem 0 .2rem; }
.gs-tchip { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .25rem 1.1rem .25rem .8rem; border-radius: 999px; border: 1.5px solid #f0d596; background: #fffdf8; color: #2c1e12; font-weight: 700; font-size: 1.02rem; cursor: pointer; box-shadow: 0 1px 4px rgba(150,90,20,.12); }
.gs-tchip:hover { border-color: #c98a2a; background: #fff3dc; }
.gs-tchip .gs-i { width: 1.35rem; height: 1.35rem; }
.gs-tools { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.gs-tb.btn { min-height: 2.7rem; border-radius: 12px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #3a1d0b; font-weight: 700; }
.gs-tb.btn:hover { background: #fff3dc; }
/* bảng từng cây */
.gs-tree { margin: 1.2rem 0 1.4rem; scroll-margin-top: 1rem; }
.gs-thead { position: relative; display: flex; align-items: center; min-height: 6rem; margin-bottom: -1.2rem; padding-left: .6rem;
  background: url("../img/fx/banner.jpg") right top / auto 100% no-repeat; }
.gs-emb { position: relative; z-index: 2; flex: none; display: grid; place-items: center; width: 4.6rem; height: 4.6rem; border-radius: 50%; color: #ffd463;
  background: radial-gradient(circle at 40% 35%, #d0302a, #8e0d12); border: 3px solid #e6b155; box-shadow: 0 3px 10px rgba(120,20,10,.35); }
.gs-emb svg { width: 2.5rem; height: 2.5rem; }
.gs-th { position: relative; z-index: 1; margin: 0 0 0 -1.4rem; padding: .55rem 3rem .55rem 2rem; color: #fff; font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(180deg, #c8261f, #8e0d12); clip-path: polygon(0 0, calc(100% - 2.3rem) 0, 100% 100%, 0 100%); border-radius: 0 0 0 0; display: flex; gap: .5rem; align-items: center; }
.gs-th .chip { background: #ffd463; color: #7a1a10; }
.gs-tbox { position: relative; z-index: 1; border: 1.5px solid #ecc874; border-radius: 18px; background: #fffdf8; box-shadow: 0 5px 16px rgba(150,90,20,.16); overflow: hidden; }
.gs-scroll { overflow-x: auto; }
.gs-tbox .gs-table { box-shadow: none; border-radius: 0; background: transparent; }
.gs-tbox .gs-table th { background: linear-gradient(180deg, #fff3d8, #fbe7bd); color: #3a1d0b; font-weight: 800; padding: .75rem .7rem; text-align: left; border-bottom: 1.5px solid #f0d596; }
.gs-tbox .gs-table th:first-child, .gs-tbox .gs-table th:nth-child(7), .gs-tbox .gs-table th:last-child { text-align: center; }
.gs-tbox .gs-table td { padding: .5rem .7rem; border-top: 1px solid #f3e6c8; color: #2c1e12; }
.gs-tbox .gs-table tbody tr:nth-child(even) td { background: #fff9ee; }
.gs-tbox .gs-table tbody tr:hover td { background: #fff1d6; }
.gs-tbox .gs-table td.num { text-align: center; color: #2c1e12; width: 3rem; }
.gs-tbox .gs-table td.cnt { text-align: center; }
.gs-tbox .gs-table td.name b { font-size: 1.05rem; color: #1e140c; }
.gs-tbox .gs-table td.name .avatar { width: 2.3rem; height: 2.3rem; font-weight: 800; color: #a3141a; background: #fde8cf; }
.gs-tbox .gs-table tr.female td.name .avatar { color: #1f6a1b; background: #e3f5df; }
.gs-tbox .gs-table td.act { text-align: center; }
.gs-so.btn { gap: .4rem; min-height: 2.4rem; border-radius: 10px; border: 1.5px solid #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.gs-so .gs-i { width: 1.15rem; height: 1.15rem; color: #ffd463; }
.gs-hs.btn { min-height: 2.4rem; border-radius: 10px; border: 1.5px solid #e3707a; background: #fffdf8; color: #c8121b; font-weight: 700; }
.gs-hs.btn:hover { background: #fff1ee; }
.gs-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 1rem; padding: .8rem 1.2rem; border-top: 1.5px solid #f0d596; background: #fffaf0; color: #2c1e12; }
.gs-pl { display: inline-flex; align-items: center; gap: .5rem; }
.gs-psize { min-height: 2.4rem; border-radius: 10px; border: 1.5px solid #e2c48a; background: #fff; padding: 0 .6rem; font-weight: 700; }
.gs-pages { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.gs-pb { min-width: 2.4rem; height: 2.4rem; padding: 0 .5rem; border-radius: 10px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #3a1d0b; font-weight: 800; cursor: pointer; }
.gs-pb:hover:not(:disabled) { background: #fff3dc; }
.gs-pb.on { background: linear-gradient(180deg, #c8261f, #8e0d12); border-color: #7a0c10; color: #fff; }
.gs-pb:disabled:not(.on) { opacity: .45; cursor: default; }
.gs-dots { color: #8a6a4a; }
.gs-total { font-weight: 600; }
@media (max-width: 760px) {
  .gs-thead { min-height: 4.6rem; margin-bottom: -.9rem; background-size: auto 70%; background-position: right bottom; }
  .gs-emb { width: 3.4rem; height: 3.4rem; } .gs-emb svg { width: 1.8rem; height: 1.8rem; }
  .gs-th { font-size: 1.05rem; padding-right: 2.4rem; }
  .gs-tbox .gs-table td { border-top: 0; padding: .1rem 0; background: transparent !important; }
  .gs-tbox .gs-table tr { border-top: 1px solid #f3e6c8; }
  .gs-tbox .gs-table td.act, .gs-tbox .gs-table td.cnt { text-align: left; }
  .gs-pager { justify-content: center; }
}
@media (min-width: 761px) {
  .gs-tbox .gs-table td.name { display: table-cell; white-space: normal; }
  .gs-tbox .gs-table td.name > .avatar { display: inline-grid; vertical-align: middle; margin-right: .6rem; }
  .gs-tbox .gs-table td.name > span { vertical-align: middle; }
}
@media (max-width: 700px) { .fx-center::after { opacity: .25; } }
.gs-tbox .gs-table td.act .btn { vertical-align: middle; margin: .15rem .2rem; }

/* ===== 1.7.4: chia sẻ link / ảnh JPG ở Thông tin dòng họ ===== */
.cs-page { overflow-x: clip; }
.sh2 { display: inline-flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.sh2-b.btn { gap: .35rem; min-height: 2.5rem; padding: .25rem .9rem; border-radius: 999px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #7a1a10; font-weight: 700; white-space: nowrap; }
.sh2-b.btn:hover { background: #fff3dc; border-color: #c98a2a; }
.sh2-b .ic { width: 1.05rem; height: 1.05rem; }
.cs-card .sh2 { justify-self: start; margin-top: .35rem; }
.cs-card .sh2-b.btn { min-height: 2.3rem; padding: .15rem .75rem; font-size: .92rem; }
.cs-read .modal-foot .sh2 { flex: none; }
.cs-read .modal-foot .sh2-b.btn { min-height: 2.9rem; border-radius: 12px; }
.ng-item .sh2.sm .sh2-b .t { display: none; }
.ng-item .sh2.sm .sh2-b.btn { padding-inline: .6rem; }
@media (max-width: 640px) {
  .sh2.sm .sh2-b .t { display: none; }
  .sh2.sm .sh2-b.btn { padding-inline: .65rem; }
  .cs-read .modal-foot .sh2-b .t { display: none; }
}
.cs-read .modal-foot { flex-wrap: wrap; }
@media (max-width: 1439px) and (min-width: 900px) { .cs-read .modal-foot { padding-left: 1.2rem; justify-content: flex-end; } .cs-read .modal-foot .btn.main { flex: 0 1 12rem; } }

/* ===== 1.7.5: Quy ước chi họ theo mẫu ===== */
.qu-page { position: relative; max-width: 96rem; isolation: isolate; overflow-x: clip; }
.qu-i { display: inline-grid; flex: none; width: 1.2rem; height: 1.2rem; }
.qu-i svg { width: 100%; height: 100%; }
.qu-crumb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem 1.2rem; margin: .1rem 0 .9rem; border-radius: 999px;
  background: #fffaf0; border: 1.5px solid #f0d596; box-shadow: 0 2px 8px rgba(150,90,20,.12); color: #2c1e12; font-size: 1rem; }
.qu-crumb a { display: inline-flex; align-items: center; gap: .4rem; color: #2c1e12; text-decoration: none; }
.qu-crumb a:hover { color: #a3141a; }
.qu-crumb .home { width: 1.35rem; height: 1.35rem; color: #c8121b; }
.qu-crumb .sep { color: #c8121b; font-weight: 800; }
.qu-crumb b { color: #2c1e12; }
.qu-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1rem; min-height: 5.6rem;
  padding: .3rem .4rem .3rem 0; border-radius: 18px 18px 0 0; background: url("../img/fx/banner.jpg") right top / auto 100% no-repeat, linear-gradient(180deg, #fff6e2, #fdf0d4); border: 1.5px solid #ecc874; border-bottom: 0; }
.qu-rib { display: inline-flex; align-items: center; gap: 1rem; margin: 0; padding: .7rem 3.6rem .7rem 1.4rem; min-height: 4.6rem; border-radius: 18px 0 0 0;
  color: #fff; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 2rem; font-weight: 700; line-height: 1.15;
  background: linear-gradient(180deg, #c8261f, #8e0d12); clip-path: polygon(0 0, calc(100% - 3rem) 0, 100% 100%, 0 100%); box-shadow: 0 3px 0 #e6b155 inset; }
.qu-rib .book { width: 3.4rem; height: 2.8rem; }
.qu-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding-right: .8rem; }
.qu-b.btn { gap: .5rem; min-height: 3rem; padding: .3rem 1.4rem; border-radius: 14px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #7a1a10; font-weight: 800; font-size: 1.05rem; box-shadow: 0 2px 8px rgba(150,90,20,.18); }
.qu-b.btn:hover { background: #fff3dc; }
.qu-b.main { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.qu-tools .sh2-b.btn { min-height: 3rem; border-radius: 14px; background: rgba(255,253,248,.95); }
.qu-note { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .7rem 1.4rem; color: #2c1e12; font-size: 1rem;
  background: #fffaf0; border-left: 1.5px solid #ecc874; border-right: 1.5px solid #ecc874; border-bottom: 1px solid #f3e1b4; }
.qu-note .qu-i { width: 1.35rem; height: 1.35rem; color: #b5631a; }
.qu-body { padding: 1.2rem 1.6rem 1.4rem; border: 1.5px solid #ecc874; border-top: 0; border-radius: 0 0 18px 18px; background: linear-gradient(180deg, #fffaf0, #fdf4e2); box-shadow: 0 6px 18px rgba(150,90,20,.12); }
.qu-quote { position: relative; isolation: isolate; overflow: hidden; display: flex; gap: 1.1rem; margin: 0 0 1.4rem; padding: 1.1rem 9rem 1.1rem 1.3rem; border: 1.5px solid #ecc874; border-radius: 16px; background: #fff6e2; }
.qu-quote::after { content: ""; position: absolute; z-index: -1; right: 0; top: 0; bottom: 0; width: 15rem; pointer-events: none; opacity: .9;
  background: url("../img/gio/hoa-sen-trang.jpg") right center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%); mask-image: linear-gradient(90deg, transparent 0, #000 45%); }
.qu-quote .q { width: 2.6rem; height: 2rem; flex: none; margin-top: .2rem; }
.qu-quote p { margin: 0; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-style: italic; font-size: 1.12rem; line-height: 1.65; color: #2c1e12; }
.qu-count { display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; padding: .35rem 1.2rem .35rem .8rem; border-radius: 999px;
  background: linear-gradient(90deg, #fde7c7, rgba(253,231,199,0)); color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.qu-count .qu-i { width: 2rem; height: 1.5rem; }
.qu-list { list-style: none; margin: 0; padding: 0 0 0 .6rem; display: grid; gap: .75rem; }
.qu-list li { display: grid; grid-template-columns: 6.6rem 1fr; gap: 1rem; align-items: start; }
.qu-tag { justify-self: start; padding: .2rem .8rem; border-radius: 8px; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-weight: 800; font-size: .98rem; white-space: nowrap; box-shadow: 0 2px 4px rgba(120,20,10,.25); }
.qu-txt { color: #1e140c; font-size: 1.04rem; line-height: 1.6; }
.qu-txt p { margin: 0; }
.qu-txt b { display: block; color: #7a1a10; }
.qu-ket { display: grid; gap: .45rem; margin: 1.3rem 0 0 .6rem; }
.qu-ket p { display: flex; align-items: flex-start; gap: .6rem; margin: 0; color: #2c1e12; }
.qu-ket .qu-i { width: 1.3rem; height: 1.3rem; margin-top: .15rem; }
.qu-prose { font-size: 1.04rem; line-height: 1.7; }
.qu-empty { text-align: center; }
.qu-foot { margin: 1.2rem 0 0; width: 100%; aspect-ratio: 1536 / 184; background: url("../img/cs/chan.jpg") center bottom / 100% 100% no-repeat; }
@media (max-width: 760px) {
  .qu-head { background: linear-gradient(180deg, #fff6e2, #fdf0d4); padding-bottom: .6rem; }
  .qu-rib { font-size: 1.35rem; min-height: 3.6rem; padding-right: 2.8rem; gap: .6rem; }
  .qu-rib .book { width: 2.4rem; height: 2rem; }
  .qu-tools { padding: 0 .6rem; }
  .qu-body { padding: 1rem; }
  .qu-quote { padding: 1rem; }
  .qu-quote::after { opacity: .25; width: 100%; }
  .qu-b.btn, .qu-tools .sh2-b.btn { min-height: 2.6rem; padding: .2rem .9rem; font-size: .95rem; }
  .qu-tools .sh2-b .t { display: none; }
  .qu-list { padding: 0; }
  .qu-list li { grid-template-columns: 1fr; gap: .3rem; }
}

/* ===== 1.7.6: Thờ tự - Mồ mả · Ban liên lạc · Niên giám theo mẫu (dùng khung .qu-*) ===== */
.qu-note > span:last-child { min-width: 0; }
.qu-rib .book svg { overflow: visible; }
.qu-page .qu-body { position: relative; }
/* --- Thờ tự, Mồ mả --- */
.mm-sec { margin: 0 0 1.4rem; border: 1.5px solid #ecc874; border-radius: 16px; background: #fffaf0; box-shadow: 0 3px 10px rgba(150,90,20,.1); overflow: hidden; }
.mm-sec:last-child { margin-bottom: 0; }
.mm-rib { display: inline-flex; align-items: center; gap: .6rem; margin: 0; padding: .55rem 2.6rem .55rem 1.1rem; min-height: 3rem; max-width: 100%; border-radius: 14px 0 0 0;
  color: #fff; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.22rem; font-weight: 700; line-height: 1.2;
  background: linear-gradient(180deg, #c8261f, #8e0d12); clip-path: polygon(0 0, calc(100% - 2.1rem) 0, 100% 100%, 0 100%); }
.mm-rib .qu-i { width: 1.5rem; height: 1.5rem; color: #ffd463; }
.mm-pill { display: inline-grid; place-items: center; min-width: 2rem; padding: .05rem .6rem; border-radius: 999px; background: linear-gradient(180deg, #ffe08a, #e6a417); color: #6b1408; font-family: system-ui, sans-serif; font-size: .95rem; font-weight: 800; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr)); gap: .9rem; padding: 1rem; }
.mm-card { display: grid; gap: .55rem; align-content: start; padding: .9rem 1rem; border: 1.5px solid #f0d596; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(150,90,20,.1); min-width: 0; }
.mm-top { display: flex; align-items: center; gap: .8rem; padding-bottom: .6rem; border-bottom: 1px dashed #ecc874; }
.mm-av { flex: none; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1c2, #f2c45a 60%, #d9982a); border: 2px solid #fff; box-shadow: 0 0 0 2px #e6b155;
  color: #8e0d12; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-weight: 800; font-size: 1.05rem; }
.mm-who { display: grid; gap: .15rem; min-width: 0; }
.mm-name.linkish { justify-self: start; text-align: left; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.mm-meta { display: inline-flex; align-items: center; gap: .4rem; color: #5b4632; font-size: .95rem; }
.mm-meta .qu-i { width: 1.1rem; height: 1.1rem; }
.mm-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mm-ic.qu-i { width: 1.5rem; height: 1.5rem; }
.mm-t { flex: 1 1 12rem; min-width: 0; color: #2c1e12; line-height: 1.45; }
.mm-t b { color: #7a1a10; }
.mm-ok { display: inline-flex; align-items: center; gap: .25rem; margin-left: .45rem; padding: .1rem .6rem .1rem .4rem; border-radius: 999px; background: #e3f4dc; border: 1px solid #9bcf8a; color: #23661f; font-size: .85rem; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.mm-ok .qu-i { width: .95rem; height: .95rem; }
.mm-acts { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.mm-go.btn { gap: .35rem; min-height: 2.3rem; padding: .15rem .9rem; border-radius: 10px; border: 1.5px solid #c8261f; background: #fff; color: #a3141a; font-weight: 800; font-size: .92rem; margin-left: auto; }
.mm-acts .mm-go.btn { margin-left: 0; }
.mm-go.btn:hover { background: #fff0ec; }
.mm-go .qu-i { width: 1rem; height: 1rem; }
/* --- Ban liên lạc --- */
.bl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.bl-card { display: grid; grid-template-columns: auto 1fr; gap: .9rem 1rem; align-items: start; padding: 1rem 1.1rem; border: 1.5px solid #f0d596; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 3px 10px rgba(150,90,20,.12); min-width: 0; }
.bl-av { display: grid; place-items: center; width: 4.6rem; height: 4.6rem; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 35% 30%, #fff1c2, #f2c45a 60%, #d9982a); border: 3px solid #fff; box-shadow: 0 0 0 2px #e6b155, 0 3px 8px rgba(150,90,20,.25);
  color: #8e0d12; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 2.1rem; font-weight: 800; }
.bl-av.dead { filter: grayscale(.35); }
.bl-main { display: grid; gap: .3rem; min-width: 0; }
.bl-role { justify-self: start; display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .75rem .15rem .55rem; border-radius: 999px; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-weight: 800; font-size: .9rem; }
.bl-role .qu-i { width: .95rem; height: .95rem; color: #ffd463; }
.bl-name { margin: 0; }
.bl-name .linkish { text-align: left; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
.bl-meta { display: inline-flex; align-items: center; gap: .4rem; color: #5b4632; font-size: .95rem; }
.bl-meta .qu-i { width: 1.15rem; height: 1.15rem; }
.bl-x { color: #2c1e12; font-size: .93rem; }
.bl-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .7rem; border-top: 1px dashed #ecc874; }
.bl-b.btn { gap: .3rem; min-height: 2.3rem; padding: .15rem .75rem; border-radius: 10px; border: 1.5px solid #e2a79d; background: #fff; color: #a3141a; font-weight: 700; font-size: .9rem; }
.bl-b.btn:hover:not(:disabled) { background: #fff0ec; border-color: #c8261f; }
.bl-b.btn:disabled { opacity: .45; }
.bl-b.tel { border-color: #9bcf8a; color: #23661f; }
.bl-b.danger { border-color: #c8261f; }
/* --- Niên giám --- */
.ng-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; padding: .7rem .9rem; margin-bottom: .9rem; border: 1.5px solid #f0d596; border-radius: 14px; background: #fff; }
.ng-sel { display: inline-flex; align-items: center; gap: .5rem; color: #a3141a; }
.ng-sel > .qu-i { width: 1.4rem; height: 1.4rem; }
.ng-sel .chi-pick { display: inline-flex; flex-wrap: wrap; gap: .5rem; }
.ng-sel select { min-height: 2.6rem; border: 1.5px solid #e2c48a; border-radius: 10px; background: #fffdf8; color: #2c1e12; font-weight: 600; }
.ng-chk { display: inline-flex; align-items: center; gap: .45rem; color: #2c1e12; font-size: .95rem; cursor: pointer; }
.ng-chk input { width: 1.15rem; height: 1.15rem; accent-color: #c8261f; }
.ng-acts { display: inline-flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; align-items: center; }
.ng-acts .qu-b.btn, .ng-acts .sh2-b.btn { min-height: 2.6rem; border-radius: 12px; font-size: .98rem; }
.ng-decs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.ng-dec { padding: .35rem 1.1rem; border-radius: 999px; border: 1.5px solid #e2c48a; background: #fffdf8; color: #7a1a10; font-weight: 800; cursor: pointer; }
.ng-dec:hover { background: #fff3dc; }
.ng-dec.on { border-color: #8e0d12; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.ng-tree { position: relative; display: grid; gap: 2.2rem; padding: 1.2rem .4rem .6rem; border: 1.5px solid #f0d596; border-radius: 16px; background: url("../img/gio/hoa-sen-trang.jpg") right bottom / 16rem auto no-repeat, #fffcf5; isolation: isolate; }
.ng-lines { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ng-lines svg { display: block; }
.ng-row { display: flex; justify-content: center; gap: 1.2rem; }
.ng-row:has(> :nth-child(2):last-child) > .ng-card { flex-basis: calc((100% - 1.2rem) / 2); max-width: 24rem; }
.ng-row > .ng-card:only-child { flex-basis: min(21rem, 100%); }
.ng-card { all: unset; box-sizing: border-box; flex: 0 1 calc((100% - 3 * 1.2rem) / 4); min-width: 0; max-width: 21rem; display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem;
  border: 1.5px solid #ecc874; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px rgba(150,90,20,.14); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.ng-card:hover, .ng-card:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(150,90,20,.22); outline: 2px solid #e6b155; outline-offset: 1px; }
.ng-av { flex: none; width: 3.2rem; height: 3.2rem; }
.ng-av svg { width: 100%; height: 100%; display: block; }
.ng-body { display: grid; gap: .25rem; min-width: 0; }
.ng-pill { justify-self: start; padding: .05rem .8rem; border-radius: 999px; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-weight: 800; font-size: 1.02rem; letter-spacing: .02em; }
.ng-l { margin: 0; color: #2c1e12; font-size: .93rem; line-height: 1.4; overflow-wrap: anywhere; }
.ng-l b { color: #7a1a10; }
.ng-l.muc b { color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; }
.ng-l.mat b { color: #5b4632; }
.ng-tree.flat { gap: .9rem; padding-left: 1.6rem; }
.ng-tree.flat::before { content: ""; position: absolute; left: .8rem; top: 1.4rem; bottom: 1.4rem; width: 3px; border-radius: 3px; background: #e0b25a; z-index: -1; }
.ng-tree.flat .ng-row { flex-direction: column; gap: .9rem; }
.ng-tree.flat .ng-row > .ng-card { flex: none; max-width: none; width: 100%; }
@media (max-width: 760px) {
  .mm-grid { padding: .7rem; }
  .mm-row { display: grid; grid-template-columns: auto 1fr; gap: .4rem .55rem; align-items: start; }
  .mm-row > .mm-go.btn, .mm-row > .mm-acts { grid-column: 2; justify-self: start; margin-left: 0; }
  .mm-rib { font-size: 1.05rem; padding-right: 2.2rem; }
  .qu-note { align-items: flex-start; padding: .6rem .9rem; }
  .qu-note .qu-i { margin-top: .15rem; }
  .ng-filter { padding: .6rem; }
  .ng-sel { width: 100%; align-items: flex-start; }
  .ng-sel > .qu-i { margin-top: .6rem; }
  .ng-sel .chi-pick { flex: 1; min-width: 0; display: grid; }
  .ng-sel select { width: 100%; min-width: 0; }
  .bl-av { width: 3.8rem; height: 3.8rem; font-size: 1.7rem; }
  .ng-acts { margin-left: 0; }
  .ng-acts .sh2-b .t { display: none; }
  .ng-tree { background: #fffcf5; }
}

/* ===== 1.7.7: Theo đời (cây đang xem) · Hồ sơ người kiểu đỏ – vàng ===== */
.gs-crumb.gs-switch { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; padding: .45rem 1.2rem; margin: .2rem 0 1rem; border-radius: 999px;
  background: #fffaf0; border: 1.5px solid #f0d596; box-shadow: 0 2px 8px rgba(150,90,20,.12); }
.gs-crumb .gs-home { width: 1.4rem; height: 1.4rem; color: #c8121b; }
.gs-crumb .gs-sep { color: #c8121b; font-weight: 800; }
.gs-t { all: unset; cursor: pointer; padding: .15rem .1rem; color: #a3141a; font-weight: 600; font-size: 1rem; border-bottom: 2px solid transparent; }
.gs-t:hover { border-bottom-color: #e6b155; }
.gs-t.on { color: #2c1e12; font-weight: 800; cursor: default; }
.gs-t:focus-visible { outline: 2px solid #e6b155; outline-offset: 3px; border-radius: 4px; }
.gn-page { max-width: 96rem; position: relative; isolation: isolate; overflow-x: clip; }
.gn-page::before { content: ""; position: absolute; z-index: -1; right: 0; top: 0; width: min(36rem, 55%); aspect-ratio: 886 / 148; opacity: .55; pointer-events: none;
  background: url("../img/fx/banner.jpg") right top / contain no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.gn-det { margin: 0 0 .9rem; border: 1.5px solid #ecc874; border-radius: 16px; background: linear-gradient(180deg, #fffaf0, #fdf4e2); box-shadow: 0 3px 10px rgba(150,90,20,.1); overflow: hidden; }
.gn-sum { position: relative; display: flex; align-items: center; gap: .8rem; min-height: 3.4rem; padding: .5rem 4.5rem .5rem 1.3rem; cursor: pointer; list-style: none;
  color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.35rem; font-weight: 700; }
.gn-sum::-webkit-details-marker { display: none; }
.gn-sum::after { content: ""; position: absolute; right: 1rem; top: 50%; width: 3.6rem; height: 2rem; transform: translateY(-50%); opacity: .55; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 40'%3E%3Cg fill='none' stroke='%23d9a845' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 30c-4 0-4-7 1-7 0-6 8-8 11-3 2-7 13-7 14 1 6-2 10 4 6 9z'/%3E%3Cpath d='M30 22c-1-4 4-6 6-2M15 24c1-3 5-3 6 0'/%3E%3Cpath d='M40 33c-3 0-3-5 1-5 0-4 6-6 8-2 2-5 10-4 10 1 4-1 7 3 4 6z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.gn-tri { width: 0; height: 0; border-style: solid; border-width: .45rem 0 .45rem .7rem; border-color: transparent transparent transparent #c8121b; transition: transform .15s; }
.gn-det[open] > .gn-sum { color: #fff; background: linear-gradient(180deg, #c8261f, #8e0d12); box-shadow: 0 3px 0 #e6b155 inset; }
.gn-det[open] > .gn-sum::after { opacity: .9; filter: brightness(1.2); }
.gn-det[open] .gn-tri { transform: rotate(90deg); border-left-color: #fff; }
.gn-sum:focus-visible { outline: 3px solid #e6b155; outline-offset: -3px; }
.gn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .8rem; padding: 1rem; }
.gn-card { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: .85rem; min-width: 0; min-height: 4.6rem; padding: .65rem .9rem; cursor: pointer;
  border: 1.5px solid #ecc874; border-radius: 14px; background: #fffdf8; box-shadow: 0 2px 6px rgba(150,90,20,.1); transition: transform .12s, box-shadow .12s; }
.gn-card:hover, .gn-card:focus-visible { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(150,90,20,.2); outline: 2px solid #e6b155; outline-offset: 1px; }
.gn-card.female { background: linear-gradient(180deg, #ecf8e8, #dcf1d5); border-color: #8fc983; }
.gn-av { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 35% 30%, #fff6e2, #f3d9a8);
  border: 2px solid #fff; box-shadow: 0 0 0 1.5px #e6c27a; color: #8a3a12; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-weight: 800; font-size: 1.25rem; }
.gn-card.dead .gn-av { filter: saturate(.7); }
.gn-who { display: grid; gap: .1rem; min-width: 0; }
.gn-who b { color: #2c1e12; font-size: 1.05rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gn-who small { color: #6b5540; font-size: .9rem; }
@media (max-width: 760px) { .gn-sum { font-size: 1.15rem; padding-left: 1rem; } .gn-grid { padding: .7rem; gap: .6rem; } .gs-crumb.gs-switch { border-radius: 16px; } }

/* --- Hồ sơ người (khung phải / tấm trượt) --- */
@media (min-width: 1280px) { .shell.panel-open { --panel-w: 480px; } }
.panel-body.ps { padding: .8rem .9rem 0; background: linear-gradient(180deg, #fffaf0, #fdf4e2); }
.ps-i { display: inline-grid; flex: none; width: 1.15rem; height: 1.15rem; }
.ps-i svg { width: 100%; height: 100%; }
.ps-hero { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1rem .8rem .6rem; margin: -.8rem -.9rem 0; isolation: isolate; overflow: hidden;
  background: url("../img/fx/banner.jpg") right top / auto 7.5rem no-repeat; }
.ps-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #fffaf0 35%, rgba(255,250,240,.55) 75%, rgba(255,250,240,.2)); }
.ps-av { position: relative; flex: none; width: 6.4rem; height: 6.4rem; border-radius: 50%; padding: .35rem;
  background: conic-gradient(from 30deg, #f6d27a, #c9902e, #f9e3a3, #b97a20, #f6d27a); box-shadow: 0 4px 14px rgba(150,90,20,.3); }
.ps-av > img, .ps-av > span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; object-fit: cover; background: radial-gradient(circle at 40% 35%, #fffaf0, #f6e3bf);
  border: 2px solid #fff; color: #7a1a10; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 3rem; font-weight: 800; line-height: 1; }
.ps-av.female > span { background: radial-gradient(circle at 40% 35%, #f3fbf0, #d6efcd); color: #1f4a1b; }
.ps-cam { position: absolute; right: -.15rem; bottom: .1rem; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.ps-cam svg { width: 1.15rem; height: 1.15rem; }
.ps-who { min-width: 0; display: grid; gap: .3rem; }
.ps-who h2 { margin: 0; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.75rem; line-height: 1.2; text-shadow: 0 1px 0 #fff; }
.ps-alias { display: flex; align-items: center; gap: .35rem; color: #2c1e12; font-size: .95rem; }
.ps-alias .ps-i { color: #5b4632; }
.ps-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ps-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .8rem; border-radius: 999px; border: 1.5px solid #e2c48a; background: #fff8e8; color: #5b2a10; font-weight: 800; font-size: .92rem; }
.ps-chip.red { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.ps-chip.red .ps-i { color: #fff; }
.ps-chip.soft { font-weight: 700; color: #6b5540; }
.ps-orn { height: 1rem; margin: .2rem 2rem .6rem; background: radial-gradient(circle, #d9a845 0 .28rem, transparent .3rem) center / 1rem 1rem no-repeat, linear-gradient(90deg, transparent, #d9a845 15%, #d9a845 85%, transparent) center / 100% 2px no-repeat; }
.ps-sec { margin: 0 0 1rem; }
.ps-rib { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 -.2rem .2rem; padding: .45rem 2.4rem .45rem 1rem; min-height: 2.6rem;
  color: #fff; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.15rem; font-weight: 700; border-radius: 12px 0 0 0;
  background: linear-gradient(180deg, #c8261f, #8e0d12); clip-path: polygon(0 0, calc(100% - 1.8rem) 0, 100% 50%, calc(100% - 1.8rem) 100%, 0 100%); box-shadow: 0 2px 0 #e6b155 inset; }
.ps-rib .ps-i { width: 1.3rem; height: 1.3rem; color: #fff; }
.ps-box { position: relative; padding: 1rem .9rem .9rem; border: 1.5px solid #ecc874; border-radius: 0 14px 14px 14px; background: #fffaf0; box-shadow: 0 3px 10px rgba(150,90,20,.08); isolation: isolate; overflow: hidden; }
.ps-box::after { content: ""; position: absolute; z-index: -1; right: 0; bottom: 0; width: 12rem; height: 5rem; opacity: .35; pointer-events: none;
  background: url("../img/cs/nui.jpg") right bottom / cover no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent, #000 50%); mask-image: linear-gradient(90deg, transparent, #000 50%); }
.ps-bio p { margin: 0 0 .7rem; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-style: italic; font-size: 1.05rem; line-height: 1.7; color: #2c1e12; white-space: pre-wrap; }
.ps-bio p:last-child { margin-bottom: 0; }
.ps-bio p:first-child::first-letter { float: left; margin: .1rem .45rem 0 0; color: #a3141a; font-size: 3.4rem; line-height: .85; font-style: italic; font-weight: 800; }
.ps-info { width: 100%; border-collapse: collapse; }
.ps-info th, .ps-info td { padding: .5rem .5rem; border-bottom: 1px solid #f1e2bf; text-align: left; vertical-align: middle; }
.ps-info tr:last-child th, .ps-info tr:last-child td { border-bottom: 0; }
.ps-info th { width: 40%; color: #3c2a1c; font-weight: 500; background: rgba(253,240,212,.6); }
.ps-info td { color: #2c1e12; }
.ps-info td > .ps-i, .ps-info td > .ps-g { margin-right: .55rem; vertical-align: -.2rem; }
.ps-info td b { font-weight: 700; }
.ps-g.ps-i { width: 1.3rem; height: 1.3rem; }
.ps-g.m { color: #1e78d6; } .ps-g.f { color: #d6337a; }
.ps-rel + .ps-rel { margin-top: .6rem; }
.ps-rel .lbl { color: #2c1e12; font-size: 1rem; margin-bottom: .35rem; }
.ps-pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.ps-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .95rem .35rem .7rem; border-radius: 999px; cursor: pointer; border: 1.5px solid #e2c48a; background: #fffdf8; color: #2c1e12; font-weight: 700; font-size: .98rem; box-shadow: 0 1px 3px rgba(150,90,20,.12); }
.ps-pill .ps-i { color: #7a4a1e; }
.ps-pill:hover { border-color: #c8261f; }
.ps-pill.female { background: #e9f6e4; border-color: #93cf8b; }
.ps-box .btn.block { margin-top: .7rem; }
.ps-share { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }
.ps-b.btn { gap: .4rem; min-height: 2.8rem; padding: .2rem 1rem; border-radius: 14px; border: 1.5px solid #c8261f; background: #fffdf8; color: #a3141a; font-weight: 800; font-size: .98rem; text-decoration: none; }
.ps-b.btn:hover { background: #fff0ec; }
.ps-b.main { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.ps-b.zalo { border-color: #0068ff; color: #0068ff; }
.ps-b.fb { border-color: #1877f2; color: #1877f2; }
.ps-z { display: inline-grid; place-items: center; padding: 0 .25rem; height: 1.2rem; border-radius: 4px; background: #0068ff; color: #fff; font-size: .62rem; font-weight: 900; }
.ps-f { display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #1877f2; color: #fff; font-size: .85rem; font-weight: 900; font-family: Arial, sans-serif; }
.ps .actions-sticky { z-index: 3; background: #fdf4e2; border-top-color: #ecc874; }
.ps-foot { margin: .4rem -.9rem 0; aspect-ratio: 1536 / 184; background: url("../img/cs/chan.jpg") center bottom / 100% 100% no-repeat; }
@media print { .ps-cam, .ps-share { display: none; } }

/* ===== 1.7.8: khung trang chung .pf (Ký sự, Check-in, Địa danh, Góp ý, Duyệt bài, Tài khoản) ===== */
.view.pf { position: relative; max-width: 96rem; isolation: isolate; overflow-x: clip; padding-top: .6rem; }
.pf::before { content: ""; position: absolute; z-index: -1; left: -1rem; top: -.5rem; width: min(30rem, 42%); height: 15rem; pointer-events: none;
  background: url("../img/pd/mai-tl.webp") left top / auto 100% no-repeat; opacity: .95; }
.pf::after { content: ""; position: absolute; z-index: -1; right: -.5rem; top: -.5rem; width: min(40rem, 55%); height: 13rem; pointer-events: none;
  background: url("../img/pd/mai-tr.webp") right top / auto 100% no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%); mask-image: linear-gradient(90deg, transparent, #000 35%); }
.pf-i { display: inline-grid; flex: none; width: 1.2rem; height: 1.2rem; }
.pf-i svg { width: 100%; height: 100%; }
.pf-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: 0 0 .8rem; padding-left: clamp(0rem, 6vw, 5rem); }
.pf-crumb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .45rem; min-height: 2.8rem; padding: .3rem 1.3rem .3rem .5rem; border-radius: 14px;
  background: linear-gradient(180deg, #c8261f, #8e0d12); border: 2px solid #e6b155; color: #fff; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.05rem;
  box-shadow: 0 3px 10px rgba(120,20,10,.25); }
.pf-crumb a, .pf-crumb b { color: #fff; text-decoration: none; }
.pf-crumb a:hover { color: #ffe39b; }
.pf-crumb b { font-weight: 600; }
.pf-crumb .sep { color: #ffd98a; }
.pf-crumb .pf-home, .pf-crumb .pf-back { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; }
.pf-crumb .pf-home .pf-i, .pf-crumb .pf-back .pf-i { width: 1.4rem; height: 1.4rem; }
.pf-crumb .pf-back { border-right: 1px solid rgba(255,217,138,.5); border-radius: 10px 0 0 10px; padding-right: .3rem; }
.pf-right { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pf-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; margin: 0 0 1rem; padding-left: clamp(0rem, 4vw, 3rem); }
.pf-rib { display: inline-flex; align-items: center; gap: .8rem; margin: 0; padding: .55rem 2.6rem .55rem 1.3rem; min-height: 3.8rem; border-radius: 16px;
  color: #ffe9b0; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 700; line-height: 1.15;
  background: linear-gradient(180deg, #c8261f, #7d0b10); border: 2.5px solid #e6b155; box-shadow: 0 0 0 2px #8e0d12, 0 6px 14px rgba(120,20,10,.3); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.pf-rib .pf-i.big { width: 2.6rem; height: 2.3rem; color: #fff; }
.pf-tag { margin: 0; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-style: italic; font-weight: 600; font-size: 1.15rem; }
.pf-body { position: relative; }
.pf-foot { margin: 1.2rem -1rem 0; aspect-ratio: 1536 / 184; background: url("../img/cs/chan.jpg") center bottom / 100% 100% no-repeat; }
.pf-desc { margin: 0 0 .9rem; color: #3c2a1c; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-style: italic; font-size: 1.05rem; }
.pf-note { margin: 0 0 1rem; padding: .5rem 1rem; border-left: 4px solid #e6b155; background: rgba(255,250,240,.75); border-radius: 0 10px 10px 0; color: #2c1e12; }
.pf-box { position: relative; margin: 0 0 1rem; padding: 1rem 1.1rem; border: 2px solid #ecc874; border-radius: 16px; background: rgba(255,250,240,.94); box-shadow: 0 4px 14px rgba(150,90,20,.12); }
.pf-empty { padding: 1.4rem; text-align: center; color: #6b5540; border: 1.5px dashed #e2c48a; border-radius: 12px; background: rgba(255,253,248,.8); }
.btn.pf-add, .btn.pf-red { gap: .4rem; border: 2px solid #e6b155; border-radius: 14px; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-weight: 800; box-shadow: 0 3px 8px rgba(120,20,10,.25); }
.btn.pf-ob { gap: .4rem; border: 1.5px solid #c8261f; border-radius: 14px; background: #fffdf8; color: #a3141a; font-weight: 800; }
.btn.pf-ob:hover { background: #fff0ec; }
.btn.pf-brown { gap: .4rem; border: 1.5px solid #8a3a12; border-radius: 14px; background: linear-gradient(180deg, #c0662a, #8a3a12); color: #fff; font-weight: 800; }
.btn.pf-ob .pf-i, .btn.pf-brown .pf-i { width: 1.1rem; height: 1.1rem; }
.pf-tabs.seg { margin: 0; }
@media (min-width: 1100px) { .pf-tabs { display: none !important; } }
/* hàng lọc */
.pf-filter { display: grid; gap: .55rem; margin: 0 0 1rem; padding: .8rem 1rem; border: 1.5px solid #ecc874; border-radius: 16px; background: rgba(255,250,240,.88); box-shadow: 0 3px 10px rgba(150,90,20,.1); }
.pf-filter.plain { background: transparent; border: 0; box-shadow: none; padding: 0; }
.pf-frow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.pf-flbl { flex: none; min-width: 7.5rem; display: inline-flex; align-items: center; gap: .45rem; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-weight: 700; font-size: 1.1rem; }
.pf-filter.plain .pf-flbl { min-width: 10rem; padding: .4rem 1rem; border-radius: 10px; color: #fff; background: linear-gradient(180deg, #c8261f, #8e0d12); border: 1.5px solid #e6b155; font-size: 1rem; box-shadow: 0 2px 6px rgba(120,20,10,.25); }
.pf-filter.plain .pf-flbl .pf-i { color: #fff; }
.pf-fchips { display: flex; flex-wrap: wrap; gap: .5rem; }
.pf-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .25rem 1.1rem; border-radius: 999px; cursor: pointer; border: 1.5px solid #e2c48a; background: #fffdf8; color: #2c1e12; font-weight: 700; font-size: .98rem; box-shadow: 0 1px 4px rgba(150,90,20,.12); }
.pf-chip:hover { border-color: #c8261f; }
.pf-chip.on { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.pf-chip .ki { width: 1.1rem; height: 1.1rem; }
.pf-sum { display: flex; align-items: center; gap: .45rem; margin: .2rem 0 .8rem; color: #3c2a1c; }
/* phân trang */
.pf-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem; margin: .4rem 0 0; }
.pf-pg { min-height: 2.5rem; padding: .2rem 1.2rem; border-radius: 999px; border: 1.5px solid #e2c48a; background: #f6ecd6; color: #6b5540; font-weight: 800; cursor: pointer; }
.pf-pg.main { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.pf-pg:disabled { opacity: .5; cursor: default; }
.pf-dots { display: inline-flex; gap: .4rem; }
.pf-dot { width: .8rem; height: .8rem; padding: 0; border-radius: 50%; border: 0; background: #e8d6b0; cursor: pointer; }
.pf-dot.on { background: #c8121b; }
.pf-pgn { color: #3c2a1c; font-weight: 600; }
.pf-side { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 3rem; height: 3rem; margin-top: -1.5rem; border-radius: 50%; cursor: pointer;
  border: 2px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-size: 2rem; line-height: 1; box-shadow: 0 3px 8px rgba(120,20,10,.3); }
.pf-side.l { left: -1.6rem; } .pf-side.r { right: -1.6rem; }
.pf-side:disabled { opacity: .45; cursor: default; }
/* --- Ký sự: lưới thẻ --- */
.ks2-box { padding: 1rem; }
.ks2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.ks2-grid > .ks-item, .ck-list .ck2 { min-width: 0; }
.ks2 .ks-item { display: flex; flex-direction: column; padding: .55rem .55rem .7rem; border: 1.5px solid #ecc874; border-radius: 14px; background: #fffdf8; box-shadow: 0 3px 10px rgba(150,90,20,.12); }
.ksc2 { display: block; color: inherit; text-decoration: none; }
.ksc2-pic { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #f4e6c8; }
.ksc2-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ksc2:hover .ksc2-pic img { transform: scale(1.04); }
.ksc2-pic.none { display: grid; place-items: center; color: #c9a06a; }
.ksc2-pic.none > .ki { width: 4rem; height: 3.4rem; }
.ksc2-badge { position: absolute; left: .55rem; bottom: .55rem; display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .7rem; border-radius: 999px; background: #fff6e2; border: 1px solid #e6c27a; color: #5b2a10; font-weight: 800; font-size: .88rem; }
.ksc2-badge .ki { width: 1rem; height: 1rem; }
.ksc2-in { display: grid; gap: .3rem; padding: .6rem .3rem 0; }
.ksc2-t { color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.15rem; line-height: 1.3; }
.ksc2-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; color: #3c2a1c; font-size: .92rem; }
.ksc2-line .ki { width: 1rem; height: 1rem; color: #b5631a; }
.ksc2-line .ki:nth-of-type(2) { margin-left: .6rem; }
.ksc2-sum { color: #2c1e12; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ks-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: auto; padding-top: .6rem; }
.ks-acts .ks-act { display: contents; }
.ks-acts .btn.sm { min-height: 2.2rem; padding: .1rem .8rem; border-radius: 999px; border: 1.5px solid #e2a79d; background: #fffdf8; color: #a3141a; font-weight: 800; font-size: .9rem; gap: .3rem; }
.ks-acts .btn.sm.ka-ok { border-color: #2f9b2a; color: #23661f; }
.ks-acts .btn.sm .ki { width: 1rem; height: 1rem; }
.ks-acts .sh2 .btn.sm { border-color: #e2c48a; color: #7a1a10; }
.ks-item.st-an, .ck2.st-an { opacity: .7; }
/* --- Check-in --- */
.pf-month { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 .7rem; }
.pf-mrib { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem 1.6rem .45rem 1rem; border-radius: 12px; color: #fff; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(180deg, #c8261f, #8e0d12); border: 2px solid #e6b155; box-shadow: 0 3px 8px rgba(120,20,10,.25); }
.pf-mrib .pf-i { width: 1.4rem; height: 1.4rem; }
.pf-orn { flex: 1; height: 1.6rem; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 28'%3E%3Cg fill='%23e6a417'%3E%3Cpath d='M20 3c3 4 4 9 0 16-4-7-3-12 0-16z'/%3E%3Cpath d='M8 9c5 1 9 5 11 11-6-1-10-5-11-11z'/%3E%3Cpath d='M32 9c-5 1-9 5-11 11 6-1 10-5 11-11z'/%3E%3C/g%3E%3C/svg%3E") center / 2.6rem 1.6rem no-repeat, linear-gradient(90deg, transparent, #d9a845 15%, #d9a845 45%, transparent 45%, transparent 55%, #d9a845 55%, #d9a845 85%, transparent) center / 100% 2px no-repeat; }
.ck-list { display: grid; gap: .9rem; }
.ck2 { display: grid; grid-template-columns: 15rem 1fr; gap: 1.1rem; padding: .8rem; border: 1.5px solid #ecc874; border-radius: 16px; background: rgba(255,253,248,.96); box-shadow: 0 3px 10px rgba(150,90,20,.12); }
.ck2-pic { position: relative; display: block; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: #f4e6c8; }
.ck2-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ck2-ph { display: grid; place-items: center; width: 100%; height: 100%; }
.ck2-ph .pf-i { width: 3rem; height: 3rem; }
.ck2-n { position: absolute; right: .4rem; bottom: .4rem; padding: .05rem .5rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .82rem; }
.ck2-body { display: grid; align-content: start; gap: .35rem; min-width: 0; }
.ck2-place { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; color: #6b5540; font-size: .95rem; }
.ck2-place a { color: #1f5aa6; font-weight: 700; text-decoration: none; }
.ck2-t { color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.3rem; font-weight: 700; line-height: 1.25; text-decoration: none; }
.ck2-meta { display: flex; align-items: center; gap: .4rem; color: #3c2a1c; font-size: .95rem; }
.ck2-meta .pf-i { color: #b5631a; }
.ck2-sum { color: #2c1e12; }
.ck2 .ks-acts { justify-content: flex-start; padding-top: .3rem; }
/* --- chi tiết bài ký sự / check-in --- */
.ksd .pf-body { margin-top: .6rem; }
.ksd-art { position: relative; margin: 1.2rem 0 1rem; padding: 2.4rem 1.6rem 1.3rem; border: 2px solid #ecc874; border-radius: 18px; background: rgba(255,250,240,.95); box-shadow: 0 0 0 5px rgba(255,250,240,.6), 0 6px 18px rgba(150,90,20,.15); }
.ck .ksd-art { margin-top: 0; padding-top: 1.3rem; }
.ksd-tag { position: absolute; left: 1.1rem; top: -1.25rem; display: inline-flex; align-items: center; gap: .55rem; padding: .4rem 1.5rem .4rem 1rem; border-radius: 12px; color: #fff;
  font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.3rem; font-weight: 700; background: linear-gradient(180deg, #c8261f, #8e0d12); border: 2px solid #e6b155; box-shadow: 0 3px 8px rgba(120,20,10,.3); }
.ksd-tag .pf-i { width: 1.4rem; height: 1.4rem; }
.ksd-t { display: flex; align-items: flex-start; gap: .5rem; margin: .3rem 0 .6rem; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.2; overflow-wrap: anywhere; }
.ksd-t .pf-i { width: 1.6rem; height: 1.6rem; margin-top: .3rem; }
.ksd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; color: #2c1e12; font-size: 1rem; }
.ksd-meta .m { display: inline-flex; align-items: center; gap: .4rem; }
.ksd-meta .m .pf-i { color: #b5631a; }
.ksd-meta .sep { color: #c9a06a; font-weight: 800; }
.ksd-orn { display: flex; align-items: center; gap: .8rem; margin: .8rem 0 1rem; }
.ksd-orn::before, .ksd-orn::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, #d9a845); }
.ksd-orn::after { background: linear-gradient(90deg, #d9a845, transparent); }
.ksd-orn .pf-i { width: 2.6rem; height: 1.8rem; }
.ksd-lead { font-weight: 700; font-size: 1.1rem; color: #2c1e12; }
.ksd-body { font-size: 1.08rem; line-height: 1.75; color: #2c1e12; }
.ksd-acts { justify-content: flex-start; padding-top: 1rem; }
.ksd-gal { position: relative; isolation: isolate; overflow: hidden; border-radius: 14px; margin: 0 0 .8rem; background: #3b2412; }
.ksd-gal::before { content: ""; position: absolute; inset: -20px; z-index: -1; background: var(--bg) center / cover no-repeat; filter: blur(18px) brightness(.55); }
.ksd-gal .slider { margin: 0; background: transparent; }
.ksd-gal .slider img { object-fit: contain; }
.ksd-galbox { padding: .6rem; border-radius: 18px; }
.ksd-galbox .ksd-gal { margin: 0; }
/* --- Địa danh --- */
.pd2 .filters2.pf-filter { padding: .9rem 1rem; }
.pd2 .f-lbl { color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-weight: 700; }
.pd2 .fchip { border-radius: 999px; border: 1.5px solid #e2c48a; background: #fffdf8; }
.pd2 .fchip.on { border-color: #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
.pd2-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.pd2-cards .ncard { border: 1.5px solid #ecc874; border-radius: 16px; background: rgba(255,253,248,.97); box-shadow: 0 3px 10px rgba(150,90,20,.14); padding: .5rem; }
.pd2-cards .ncard-pic, .pd2-cards .ncard-ph { border-radius: 12px; overflow: hidden; }
.pd2-cards .ncard-in b { color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.2rem; line-height: 1.25; }
.pd2-cards .ncard-act { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.pd2-cards .ncard-act .route { flex: 1 1 100%; justify-content: center; min-height: 2.8rem; border-radius: 14px; border: 2px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-size: 1.05rem; }
.pd2-cards .ncard-act .sh2 .btn.sm { border-radius: 999px; }
.pf-rib2 { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 -.15rem .2rem; padding: .4rem 1.8rem .4rem 1rem; border-radius: 12px; color: #fff;
  font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.25rem; font-weight: 700; background: linear-gradient(180deg, #c8261f, #8e0d12); border: 2px solid #e6b155; box-shadow: 0 3px 8px rgba(120,20,10,.25); position: relative; z-index: 1; }
.pf-rib2 .pf-i { width: 1.4rem; height: 1.4rem; color: #fff; }
.pf-rib2.big { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.pf-rib2.big .pf-i { width: 2rem; height: 2rem; }
.pf-rib2.sm { font-size: 1.05rem; padding: .25rem 1.3rem .25rem .8rem; }
.pf-sec > .pf-box { padding-top: 1.3rem; }
.pdd-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pdd-gal { padding: .55rem; }
.pdd-gal .slider { margin: 0; border-radius: 12px; overflow: hidden; }
.pdd-noimg { display: grid; place-items: center; gap: .4rem; min-height: 14rem; color: #8a6a44; border-radius: 12px; background: #f6ead0; }
.pdd-noimg .pf-i { width: 3rem; height: 3rem; }
.pdd-info .pf-rib2 { margin: -2rem 0 .6rem -.3rem; max-width: 100%; }
.pdd-info { padding-top: 1.4rem; margin-top: 1.2rem; }
.pdd-loai { margin-bottom: .4rem; }
.pdd-kv { width: 100%; border-collapse: collapse; }
.pdd-kv th, .pdd-kv td { padding: .45rem .4rem; border-bottom: 1px solid #f1e2bf; text-align: left; vertical-align: top; }
.pdd-kv th { width: 38%; color: #7a1a10; font-weight: 600; white-space: nowrap; }
.pdd-kv th .pf-i { margin-right: .45rem; vertical-align: -.2rem; color: #a3141a; }
.pdd-kv td { color: #2c1e12; }
.pf-orn2 { height: 1rem; margin: .7rem 0; background: radial-gradient(circle, #d9a845 0 .25rem, transparent .28rem) center / 1rem 1rem no-repeat, linear-gradient(90deg, transparent, #d9a845 15%, #d9a845 85%, transparent) center / 100% 2px no-repeat; }
.pdd-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.pdd-h { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; color: #7a1a10; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.3rem; }
.pdd-h .pf-i { width: 1.5rem; height: 1.5rem; color: #a3141a; }
.pdd-evl { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; color: #a3141a; font-weight: 700; }
/* --- Góp ý xây dựng + Duyệt bài --- */
.gy2-cols { display: grid; gap: 1.2rem; }
.gy2.two .gy2-cols { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.pf-h { display: flex; align-items: center; gap: .3rem; margin: 0 0 -.2rem .4rem; color: #a3141a; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.3rem; }
.pf-form.card { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.pf-form .field .lbl { font-weight: 800; color: #2c1e12; }
.pf-inp { display: flex; align-items: stretch; border: 1.5px solid #e2c48a; border-radius: 12px; background: #fffdf8; overflow: hidden; }
.pf-inp > .pf-i { width: 2.8rem; height: auto; min-height: 2.8rem; padding: .6rem; color: #a3141a; border-right: 1.5px solid #f0dcae; background: #fdf3df; }
.pf-inp.ta > .pf-i { align-self: stretch; }
.pf-inp input, .pf-inp textarea { flex: 1; min-width: 0; border: 0 !important; border-radius: 0; background: transparent; box-shadow: none !important; }
.pf-form .row .btn:first-child { border: 1.5px solid #8a3a12; background: linear-gradient(180deg, #c0662a, #8a3a12); color: #fff; }
.pf-form .row .btn.ghost { border: 1.5px solid #c8261f; color: #a3141a; background: #fffdf8; }
.pf-form > .btn.block[type=submit] { min-height: 3.4rem; border-radius: 14px; border: 2px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-size: 1.25rem; font-family: "Noto Serif", "Times New Roman", Georgia, serif; }
.gy2-item { padding: .4rem 0; border-bottom: 1px solid #f1e2bf; }
.gy2-item:last-child { border-bottom: 0; }
.gy2-mods { display: grid; gap: .6rem; }
.gy2-mod { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border: 1.5px solid #ecc874; border-radius: 14px; background: #fffdf8; color: inherit; text-decoration: none; }
.gy2-mod:hover { border-color: #c8261f; }
.gy2-mod > .pf-i { width: 1.6rem; height: 1.6rem; color: #a3141a; }
.gy2-mod > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.gy2-mod b { color: #2c1e12; }
.gy2-mod small { color: #6b5540; }
.gy2-mod.hot { border-color: #c8261f; background: #fff3ef; }
.gy2-r .pf-rib2.sm { margin-top: 1rem; }
.gy2-rec { list-style: none; margin: 0 0 .8rem; padding: .3rem .8rem; border: 1.5px solid #ecc874; border-radius: 12px; background: #fffdf8; max-height: 22rem; overflow: auto; }
.gy2-rec li { display: grid; gap: .1rem; padding: .45rem 0; border-bottom: 1px solid #f1e2bf; }
.gy2-rec li:last-child { border-bottom: 0; }
.gy2-rec b { color: #2c1e12; font-size: .95rem; }
.gy2-rec small { color: #8a3a12; }
.dy2-sec.card { margin-bottom: 1rem; }
/* --- Tài khoản --- */
.me2-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.me2-r { display: grid; gap: 0; }
.me2-who { display: flex; align-items: center; gap: .9rem; margin-bottom: .8rem; }
.me2-av { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 12px; background: #f6e3bf; color: #a3441a; }
.me2-av .pf-i { width: 2.2rem; height: 2.2rem; }
.me2-who h2 { margin: 0; color: #2c1e12; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: 1.6rem; }
.me2-who p { margin: .1rem 0 .4rem; color: #3c2a1c; }
.me2-sub { margin-top: 1rem; }
.me2-sub .pf-rib2 { margin-left: -.4rem; }
.me2-in { padding: 1rem .9rem .8rem; margin-top: -.2rem; border: 1.5px solid #ecc874; border-radius: 0 14px 14px 14px; background: #fffdf8; }
.me2-in p { margin: 0 0 .6rem; }
.me2-disp .btn.ghost { border: 1.5px solid #c8261f; color: #a3141a; border-radius: 12px; }
.me2-flags { display: grid; padding: .2rem .8rem; border: 1.5px solid #ecc874; border-radius: 12px; background: #fffdf8; }
.me2-flag { all: unset; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid #f1e2bf; cursor: pointer; }
.me2-flag:last-child { border-bottom: 0; }
.me2-flag .flag-dot { width: .7rem; height: .7rem; border-radius: 50%; background: #e6a417; }
.me2-flag b { color: #2c1e12; }
.me2-flag span:last-child { color: #3c2a1c; }
.me2-flag:hover b { color: #a3141a; }
.me2-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.me2-tool { display: flex; align-items: center; gap: .7rem; min-height: 3.6rem; padding: .5rem 1rem; border: 1.5px solid #ecc874; border-radius: 14px; background: #fffdf8; color: #a3141a; font-weight: 800; font-size: 1rem; cursor: pointer; text-align: left; }
.me2-tool:hover { border-color: #c8261f; background: #fff3ef; }
.me2-ti svg { width: 1.6rem; height: 1.6rem; }
.me2-guide li { margin-bottom: .5rem; line-height: 1.55; }
.me2 .app-ver { text-align: center; }
/* --- hộp Nhãn nhóm --- */
.grp-modal { background: linear-gradient(180deg, #fffaf0, #fdf1d8); border: 2px solid #e6b155; }
.grp-modal .modal-head { background: linear-gradient(180deg, #fff6e2, #fbe9c6); border-bottom: 1.5px solid #ecc874; color: #7a1a10; font-family: "Noto Serif", "Times New Roman", Georgia, serif; }
.grp-modal .grp-h { color: #7a1a10; font-family: "Noto Serif", "Times New Roman", Georgia, serif; }
.grp-modal .grp-row { padding: .35rem .5rem; border: 1px solid #f0dcae; border-radius: 10px; background: #fffdf8; }
.grp-modal .grp-row .btn.sm { min-height: 2rem; padding: .1rem .8rem; border: 1.5px solid #c8261f; border-radius: 10px; color: #a3141a; background: #fff; font-weight: 800; }
.grp-modal .grp-row input, .grp-modal .grp-row select { border-color: #e2c48a; background: #fffdf8; }
.grp-modal .field .btn { border-radius: 12px; background: linear-gradient(180deg, #c0662a, #8a3a12); color: #fff; border: 1.5px solid #8a3a12; }
.grp-modal .btn.grp-done { flex: 1; min-height: 3rem; border-radius: 14px; background: linear-gradient(180deg, #c0662a, #8a3a12); color: #fff; border: 1.5px solid #8a3a12; font-size: 1.15rem; }
/* --- bộ đếm menu trái --- */
.gn-cnt { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.5rem; padding: 0 .45rem; margin-left: .4rem; border-radius: 999px; background: #fff3dc; border: 1px solid #e6c27a; color: #8a3a12; font-size: .8rem; font-weight: 800; line-height: 1; font-family: system-ui, sans-serif; }
.gn-cnt.zero { opacity: .6; }
.nav-sub-item .gn-cnt { margin-left: auto; }
@media (max-width: 900px) {
  .pdd-top, .gy2.two .gy2-cols, .me2-cols { grid-template-columns: 1fr; }
  .pf::after { opacity: .35; }
}
@media (max-width: 760px) {
  .pf-top, .pf-head { padding-left: 0; }
  .pf-rib { padding-right: 1.4rem; }
  .pf-side { display: none; }
  .ck2 { grid-template-columns: 1fr; }
  .pf-filter.plain .pf-flbl { min-width: 0; }
  .pf-flbl { min-width: 0; }
  .me2-tools { grid-template-columns: 1fr; }
  .ksd-art { padding: 2.2rem 1rem 1rem; }
  .pf::before { opacity: .45; }
}
.pf-desc { position: relative; padding: .45rem .9rem; border-radius: 12px; background: rgba(255,250,240,.88); }
.ksd-gal .sl-item > img { aspect-ratio: 16 / 9; max-height: 32rem; object-fit: contain; background: transparent; }
.ksd-gal .sl-item, .ksd-gal .sl-track { background: transparent; }
.pd2-cards .ncard .ncard-pic img { object-fit: cover; }
.pdd-gal .sl-item > img { object-fit: cover; }
.pdd-kv td .views > :first-child { display: none; }
.gy2 .pf-tag, .me2 .pf-tag { padding: .35rem 1.4rem; border-radius: 10px; color: #fff; font-size: 1.05rem; background: linear-gradient(180deg, #c8261f, #8e0d12); border: 1.5px solid #e6b155; box-shadow: 0 2px 6px rgba(120,20,10,.25); }
.me2-flags { max-height: 19rem; overflow: auto; }
.pf-fchips { flex: 1 1 14rem; min-width: 0; }
@media (max-width: 760px) {
  .pf-chip { min-height: 2.2rem; padding: .2rem .8rem; font-size: .92rem; }
  .pdd-kv th { width: auto; white-space: normal; }
  .pdd-kv th, .pdd-kv td { display: block; border: 0; padding: .1rem .2rem; }
  .pdd-kv tr { display: block; padding: .35rem 0; border-bottom: 1px solid #f1e2bf; }
  .pf-crumb { font-size: .95rem; }
}

/* ===== 1.7.9: hộp nhập liệu đỏ – vàng (Viết ký sự, Gửi bài, Chọn địa danh check-in, Đăng check-in) ===== */
.modal.fm2 { max-width: 820px !important; border-radius: 22px; border: 3px solid #e6b155; box-shadow: 0 0 0 4px #fff3d6, 0 0 0 6px #d9a845, 0 18px 50px rgba(60,20,5,.45);
  background: #fdf3df url("../img/cs/nui.jpg") center top / 100% auto no-repeat; }
.modal.fm2 .modal-head { position: sticky; top: 0; min-height: 5.6rem; padding: .7rem 1rem .6rem; border: 0; align-items: flex-start;
  background: linear-gradient(180deg, rgba(253,243,223,0) 0, rgba(253,243,223,.15) 60%, rgba(253,243,223,.9) 100%),
    url("../img/pd/mai-tl.webp") left top / auto 100% no-repeat, url("../img/pd/mai-tr.webp") right top / auto 100% no-repeat, #fdf3df; }
.modal.fm2 .modal-head h2 { display: inline-flex; align-items: center; gap: .7rem; margin: .4rem 0 0 .2rem; padding: .45rem 1.8rem .45rem .5rem; border-radius: 16px;
  color: #fff6dc; font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-size: clamp(1.2rem, 3.2vw, 1.75rem); font-weight: 700; line-height: 1.2;
  background: linear-gradient(180deg, #c8261f, #7d0b10); border: 2.5px solid #e6b155; box-shadow: 0 0 0 2px #8e0d12, 0 5px 12px rgba(120,20,10,.35); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.fm2-hi.pf-i { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: .45rem; border-radius: 50%; background: #fff6dc; color: #a3141a; border: 2px solid #e6b155; }
.fm2-hi.pf-i svg path[fill="#fff"] { fill: #a3141a; }
.fm2-hi.pf-i svg circle[fill="#a3141a"] { fill: #fff6dc; }
.modal.fm2 .close-btn.fm2-close { display: inline-flex; align-items: center; gap: .45rem; margin-top: .4rem; min-height: 2.9rem; padding: .3rem 1.3rem; border-radius: 16px;
  border: 2.5px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-weight: 800; font-size: 1.1rem; font-family: "Noto Serif", "Times New Roman", Georgia, serif; box-shadow: 0 3px 8px rgba(120,20,10,.3); }
.fm2-close .pf-i { width: 1.2rem; height: 1.2rem; }
.modal.fm2 .modal-body { margin: 0 .9rem; padding: 1.1rem 1.2rem .6rem; border: 2px solid #ecc874; border-radius: 16px; background: rgba(255,250,240,.95); box-shadow: inset 0 0 0 4px rgba(255,246,220,.9); }
.modal.fm2 .modal-foot { gap: .8rem; margin-top: .6rem; padding: .8rem 1.4rem 4.2rem; border: 0;
  background: url("../img/cs/chan.jpg") center bottom / 100% auto no-repeat, linear-gradient(180deg, rgba(253,243,223,.6), #fdf3df 30%); }
.modal.fm2 .modal-foot .btn { min-height: 3.3rem; border-radius: 16px; font-size: 1.2rem; font-family: "Noto Serif", "Times New Roman", Georgia, serif; gap: .6rem; }
.modal.fm2 .modal-foot .btn .pf-i { width: 1.5rem; height: 1.5rem; }
.modal.fm2 .btn.fm2-cancel { border: 2px solid #e6b155; background: linear-gradient(180deg, #fffaf0, #fbecc9); color: #a3141a; }
.modal.fm2 .btn.fm2-save { border: 2px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; box-shadow: 0 3px 10px rgba(120,20,10,.3); }
.modal.fm2 .btn.fm2-save:disabled { opacity: .65; }
/* ô nhập */
.fm2-form { display: grid; gap: .25rem; }
.fm2-form .grid2 { gap: 0 1rem; }
.fm2 .field { margin-bottom: .7rem; }
.fm2 .field .lbl, .fm2 .field > label { display: flex; align-items: center; gap: .55rem; margin-bottom: .4rem; color: #a3141a; font-weight: 800; font-size: 1.05rem; }
.fm2-li.pf-i { width: 1.45rem; height: 1.45rem; color: #b3171d; }
.fm2 input:not([type=checkbox]):not([type=radio]):not([type=file]), .fm2 select, .fm2 textarea {
  width: 100%; min-height: 2.9rem; padding: .55rem .9rem; border: 1.5px solid #e2c48a; border-radius: 12px; background: #fffdf8; color: #2c1e12; font-size: 1.02rem; box-shadow: inset 0 1px 2px rgba(150,90,20,.06); }
.fm2 input:focus, .fm2 select:focus, .fm2 textarea:focus { outline: none; border-color: #c8261f; box-shadow: 0 0 0 3px rgba(200,38,31,.15); }
.fm2-hint, .fm2 .hint { display: block; margin-top: .3rem; color: #6b5540; font-style: italic; font-size: .9rem; }
.fm2-chk { display: flex !important; align-items: center; gap: .7rem; margin: .2rem 0 .8rem; color: #3c2a1c; font-size: 1.02rem; min-height: 2.4rem; }
.fm2-chk input[type=checkbox] { width: 1.6rem; height: 1.6rem; accent-color: #a3141a; flex: none; }
/* ảnh slide + chụp ảnh */
.fm2 .field > .btn.ghost { min-height: 3rem; padding: .3rem 2.2rem; border: 2px solid #e6b155; border-radius: 16px; background: linear-gradient(180deg, #fffaf0, #fbecc9); color: #a3141a; font-weight: 800; gap: .5rem; }
.fm2 .field > .btn.ghost svg { color: #a3141a; }
.fm2 .field .row .btn:first-of-type { border: 1.5px solid #b75417; background: linear-gradient(180deg, #d56e22, #b24a12); color: #fff; border-radius: 12px; }
.fm2 .field .row .btn.ghost { border: 1.5px solid #c8261f; border-radius: 12px; background: #fffdf8; color: #a3141a; }
.fm2 .pick-grid:empty { display: none; }
/* thanh định dạng nội dung */
.rte { border: 1.5px solid #e2c48a; border-radius: 14px; background: #fff; overflow: hidden; box-shadow: inset 0 1px 2px rgba(150,90,20,.06); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; padding: .3rem .5rem; border-bottom: 1.5px solid #ecdcb8; background: linear-gradient(180deg, #fffaf0, #f7ead0); }
.rte-b { display: grid; place-items: center; width: 2.6rem; height: 2.5rem; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #2c1e12; cursor: pointer; }
.rte-b:hover, .rte-b:focus-visible { background: #f1dfb8; color: #a3141a; outline: none; }
.rte-i, .rte-i svg { display: block; width: 1.35rem; height: 1.35rem; }
.rte-sep { width: 1.5px; height: 1.8rem; margin: 0 .35rem; background: #e2c48a; }
.fm2 .rte textarea.rte-ta, .rte textarea.rte-ta { display: block; width: 100%; min-height: 12rem; border: 0 !important; border-radius: 0; box-shadow: none !important; resize: vertical; line-height: 1.6; background: #fff; }
.rte.full { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; border-radius: 0; border: 0; }
.rte.full .rte-ta { flex: 1; min-height: 0; resize: none; font-size: 1.15rem; padding: 1.2rem max(1.2rem, calc(50vw - 26rem)); }
.modal.rte-ask { max-width: 480px; }
/* nội dung có định dạng */
.rt figure.rt-fig { margin: 1rem 0; }
.rt figure.rt-fig img { max-width: 100%; height: auto; border-radius: 12px; border: 2px solid #ecc874; cursor: zoom-in; }
.rt figure.rt-fig figcaption { margin-top: .3rem; color: #6b5540; font-style: italic; font-size: .95rem; }
.rt .rt-video { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0; border-radius: 12px; overflow: hidden; background: #000; border: 2px solid #ecc874; }
.rt .rt-video iframe, .rt .rt-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rt ul { margin: .4rem 0 1rem; padding-left: 1.6rem; }
.rt li { margin: .2rem 0; }
.rt a { color: #1f5aa6; text-decoration: underline; }
/* chọn địa danh check-in */
.fm2-search { display: flex; align-items: center; gap: .5rem; margin: 0 0 .9rem; padding: 0 .4rem 0 1rem; border: 1.5px solid #e2c48a; border-radius: 999px; background: #fffdf8; box-shadow: 0 2px 6px rgba(150,90,20,.12); }
.fm2-search .pf-i { width: 1.6rem; height: 1.6rem; color: #6b5540; }
.fm2 .fm2-search input { border: 0 !important; box-shadow: none !important; background: transparent; padding-left: .2rem; }
.pick2-list { display: grid; gap: .7rem; }
.pick2 { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .75rem 1rem; border: 1.5px solid #f0dcae; border-radius: 16px; background: linear-gradient(180deg, #fffdf8, #fdf3df); text-align: left; cursor: pointer; box-shadow: 0 2px 8px rgba(150,90,20,.12); }
.pick2:hover, .pick2:focus-visible { border-color: #c8261f; outline: none; background: #fff6ec; }
.pick2-pin.pf-i { width: 2.2rem; height: 2.4rem; flex: none; }
.pick2-tx { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.pick2-tx b { color: #8e0d12; font-size: 1.15rem; line-height: 1.3; }
.pick2-tx small { color: #3c2a1c; font-size: .95rem; }
.pick2-go { display: grid; place-items: center; flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #fbe6c4; color: #a3141a; border: 1px solid #ecc874; }
.pick2-go .pf-i { width: 1.1rem; height: 1.1rem; }
.fm2-pick .modal-foot { justify-content: center; }
.modal.fm2-pick .btn.fm2-cancel { flex: 0 1 34rem; border: 2.5px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; }
/* đăng check-in */
.fm2-place { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; padding: .7rem 1rem; border: 1.5px solid #f0dcae; border-radius: 14px; background: #fbecc9; }
.fm2-place > .pf-i { width: 1.9rem; height: 2.1rem; flex: none; }
.fm2-place b { display: block; color: #8e0d12; font-size: 1.12rem; }
.fm2-place small { color: #3c2a1c; }
.fm2-ti { display: flex; align-items: center; gap: .7rem; margin: .2rem 0 .8rem; padding: 0 .3rem 0 .9rem; border: 1.5px solid #e2c48a; border-radius: 12px; background: #fffdf8; }
.fm2-ti > .pf-i { width: 1.6rem; height: 1.8rem; flex: none; }
.fm2 .fm2-ti input { border: 0 !important; box-shadow: none !important; padding-left: 0; font-weight: 800; font-size: 1.1rem; color: #2c1e12; }
.fm2-ck .field .lbl { margin-bottom: .3rem; }
@media (max-width: 760px) {
  .modal.fm2 .modal-head { min-height: 4.4rem; padding: .5rem .6rem .4rem; }
  .modal.fm2 .modal-head h2 { padding-right: 1.1rem; gap: .45rem; }
  .fm2-hi.pf-i { width: 2.1rem; height: 2.1rem; padding: .35rem; }
  .modal.fm2 .close-btn.fm2-close { padding: .2rem .8rem; min-height: 2.5rem; font-size: 1rem; }
  .modal.fm2 .modal-body { margin: 0 .4rem; padding: .9rem .8rem .4rem; }
  .modal.fm2 .modal-foot { padding: .7rem .7rem 3rem; }
  .rte-b { width: 2.3rem; height: 2.3rem; }
  .rte-sep { margin: 0 .15rem; }
  .pick2 { padding: .6rem .7rem; gap: .6rem; }
}
.rt figure.rt-fig { text-align: center; }
.rt figure.rt-fig img { max-height: 34rem; }
.fm2 .fm2-ti input, .fm2 .fm2-search input { padding-left: .1rem !important; }
.modal.fm2 .modal-foot { padding-bottom: 3.4rem; }
.rte-i, .rte-i svg { width: 1.5rem; height: 1.5rem; }
.modal.fm2 .modal-head { gap: .5rem; }
.modal.fm2 .modal-head h2 { min-width: 0; }
@media (max-width: 760px) {
  .fm2-close > span:not(.pf-i) { display: none; }
  .modal.fm2 .close-btn.fm2-close { flex: none; width: 2.7rem; padding: 0; justify-content: center; }
  .modal.fm2 .modal-head h2 { font-size: 1.12rem; }
}

/* ===== 1.8.0: nhãn "Mới", lưới check-in 3 cột, thanh công cụ Gia phả ===== */
.new-tag { position: absolute; top: .55rem; left: .55rem; z-index: 2; display: inline-flex; align-items: center; padding: .12rem .65rem; border-radius: 999px;
  background: linear-gradient(180deg, #ff4b2b, #c8121b); color: #fff; font-weight: 900; font-size: .82rem; letter-spacing: .02em; border: 1.5px solid #ffe08a;
  box-shadow: 0 2px 6px rgba(160,20,10,.4); animation: newPulse 1.8s ease-in-out infinite; }
.new-tag.sm { position: static; margin-left: .4rem; padding: .02rem .45rem; font-size: .7rem; vertical-align: .1em; animation: none; }
@keyframes newPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .new-tag { animation: none; } }
.hmc-pic { position: relative; }
.ks2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .ks2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ks2-grid { grid-template-columns: minmax(0, 1fr); } }
.ck2-grid { margin-bottom: .6rem; }
.ckc .ksc2-pic { display: block; }
.ckc .ksc2-pic.none { display: grid; place-items: center; }
.ckc-ph.pf-i { width: 3.4rem; height: 3.8rem; opacity: .55; }
.ckc .ksc2-badge .pf-i { width: 1rem; height: 1rem; }
.ckc .ck2-n { top: auto; }
.ckc .ck2-place { font-size: .92rem; }
.ckc .ksc2-t { text-decoration: none; font-weight: 700; }
.ckc-u.pf-i { width: 1rem; height: 1rem; margin-left: .5rem; color: #b5631a; }
/* thanh công cụ Gia phả */
.tb2 { position: relative; z-index: 3; margin: .5rem .6rem .4rem; padding: .7rem .9rem .55rem; border: 2px solid #ecc874; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,250,238,.97), rgba(253,240,214,.97)); box-shadow: 0 0 0 4px rgba(255,246,222,.7), 0 4px 14px rgba(150,90,20,.15); }
.tb2 .tree-pick { padding: 0 0 .55rem; margin: 0 0 .55rem; background: transparent; border: 0; border-bottom: 1.5px dashed #e7cf9b; gap: .7rem; }
.tb2-tree { display: grid; place-items: center; width: 2.6rem; height: 2.4rem; color: #a3141a; flex: none; }
.tb2-tree svg { width: 2.3rem; height: 2rem; }
.tb2 .tp-sel { display: grid; gap: .1rem; flex: 0 1 27rem; min-width: 0; }
.tb2 .tp-lbl { color: #8e2a12; font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.tb2 .tp-sel select { width: 100%; min-height: 2.7rem; padding: .35rem 2.2rem .35rem .9rem; border: 1.5px solid #e2c48a; border-radius: 12px; background-color: #fffdf8; color: #2c1e12; font-weight: 700; font-size: 1.02rem; }
.tb2 .tp-name { display: grid; gap: .1rem; text-align: left; background: none; border: 0; color: #2c1e12; }
.tb2 .tp-name b { font-size: 1.1rem; }
.tb2 .tp-role { padding: .35rem 1rem; border-radius: 999px; border: 1.5px solid #2a8fa0; background: #f2fbfb; color: #126574; font-weight: 700; font-size: .92rem; cursor: pointer; }
.tb2 .tp-role.chinh { border-color: #e6b155; background: #fff6e0; color: #8a4a12; cursor: default; }
.tb2 .tp-role b { font-weight: 800; }
.tb2 .tree-bar { position: static; padding: .25rem 0; background: transparent; border: 0; gap: .5rem; }
.tb2 .tb2-r3 { padding-top: .45rem; }
.tb2 .btn.sm { min-height: 2.6rem; padding: .25rem 1rem; border-radius: 12px; font-weight: 800; gap: .4rem; }
.tb2 .btn.sm.ghost { border: 1.5px solid #e2a79d; background: #fffdf8; color: #8e0d12; }
.tb2 .btn.sm.ghost:hover { border-color: #c8261f; background: #fff3ef; }
.tb2 .btn.sm:not(.ghost) { border: 1.5px solid #7a0c10; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; box-shadow: 0 2px 6px rgba(120,20,10,.25); }
.tb2 .btn.sm.spec-btn { border-color: #d39b22; background: linear-gradient(180deg, #f2c04a, #d99a1b); color: #fff; }
.tb2 .btn.sm.spec-btn.ghost { background: #fff7e0; color: #9a6409; }
.tb2 .btn.sm:disabled { opacity: .55; }
.tb2 .btn.sm .ic { width: 1.15rem; height: 1.15rem; }
.tb2 .sel-sm { min-height: 2.6rem; padding: .25rem 2rem .25rem .8rem; border: 1.5px solid #e2c48a; border-radius: 12px; background-color: #fffdf8; color: #2c1e12; font-weight: 700; font-size: .95rem; max-width: 15rem; }
.tb2 .tree-bar .seg { display: inline-flex; gap: .2rem; padding: .2rem; margin-right: .4rem; border-radius: 14px; background: #f3e2bd; border: 1px solid #e7cf9b; }
.tb2 .tree-bar .seg button { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .2rem .9rem; border: 0; border-radius: 11px; background: transparent; color: #5b2a10; font-weight: 800; font-size: .98rem; box-shadow: none; }
.tb2 .tree-bar .seg button:hover { background: #fbefd2; }
.tb2 .tree-bar .seg button.on { background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; box-shadow: 0 2px 6px rgba(120,20,10,.3); }
.tb2-ti, .tb2-ti svg { display: block; width: 1.2rem; height: 1.2rem; }
.tb2 .tree-bar .seg button:not(.on) .tb2-ti { color: #a3141a; }
.tb2 .tree-bar .seg button.on .tb2-ti { color: #ffd463; }
html.tree-fs .tb2 { margin: .3rem; padding: .45rem .6rem .35rem; }
html.tree-fs.fs-notools .tb2 { display: none !important; }
@media (max-width: 760px) {
  .tb2 { margin: .35rem; padding: .5rem .55rem .4rem; border-radius: 14px; }
  .tb2 .tree-pick { gap: .45rem; }
  .tb2-tree { display: none; }
  .tb2 .tree-bar .seg { margin-right: 0; }
  .tb2 .tree-bar .seg button { padding: .2rem .65rem; font-size: .92rem; }
  .tb2 .btn.sm { padding: .2rem .6rem; min-height: 2.4rem; }
  .tb2 .sel-sm { max-width: 100%; flex: 1 1 10rem; }
}
.tb2 .sel-sm { max-width: 12.5rem; font-size: .92rem; padding-right: 1.8rem; }
.tb2 .tree-bar .seg button { padding: .2rem .75rem; }
.tb2 .btn.sm { padding: .25rem .85rem; }
@media (max-width: 760px) {
  .tb2 .tree-bar .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .tb2 .tree-bar .seg button { flex: none; white-space: nowrap; }
  .tb2 .sel-sm { flex: 1 1 calc(50% - .5rem); max-width: none; min-width: 0; }
  .tb2 .tb2-r3 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: .35rem; }
  .tb2 .tb2-r3 > * { flex: none; white-space: nowrap; }
}

/* ===== 1.8.1: số ngày còn lại trên dòng chữ chạy — đặt trước tên lễ, nhấp nháy ===== */
.tk-left { display: inline-flex; align-items: center; padding: .05rem .6rem; margin-right: .15rem; border-radius: 999px; font-weight: 900; white-space: nowrap;
  background: #fff; color: #c8121b; border: 1.5px solid #ffd84d; box-shadow: 0 0 0 0 rgba(255,216,77,.8); animation: tkBlink 1.1s ease-in-out infinite, tkGlow 1.6s ease-out infinite; }
.tk-i.m-ho .tk-left { background: #c8121b; color: #fff; border-color: #fff; }
.tk-left.hot { background: #ffd84d; color: #8e0d12; border-color: #fff; }
.tk-i.m-ho .tk-left.hot { background: #ff3b1f; color: #fff; }
@keyframes tkBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes tkGlow { 0% { box-shadow: 0 0 0 0 rgba(255,216,77,.85); } 100% { box-shadow: 0 0 0 7px rgba(255,216,77,0); } }
@media (prefers-reduced-motion: reduce) { .tk-left { animation: none; } }

/* ===== 1.8.2: thẻ Địa danh — nút gọn 3 hàng × 2 cột, đều nhau, không tràn ===== */
.pd2-cards .ncard { padding: .5rem .5rem .7rem; }
.pd2-cards .ncard-in { padding-bottom: .5rem; }
.pd2-cards .pl-stats, .pd2-cards .ncard-act { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; padding: 0 .55rem; margin: 0; }
.pd2-cards .pl-stats { margin-top: auto; padding-top: .55rem; border-top: 1px dashed #ecd39d; }
.pd2-cards .ncard-act { padding-top: .4rem; }
.pd2-cards .ncard-act .sh2 { display: contents; }
.pd2-cards .pl-stat, .pd2-cards .ncard-act .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-width: 0; width: 100%; min-height: 2.35rem; height: 2.35rem; margin: 0;
  padding: .1rem .45rem; border-radius: 10px; font-size: .84rem; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: none; }
.pd2-cards .pl-stat { border: 1.5px solid #e9cf98; background: #fdf3df; color: #7a1a10; }
.pd2-cards .pl-stat b { font-size: .95rem; color: #c8261f; }
.pd2-cards .pl-stat.hist b { font-size: .85rem; }
.pd2-cards .pl-stat span { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.pd2-cards .ncard-act .sh2 .btn.sm { order: 1; border: 1.5px solid #e2c48a; background: #fffdf8; color: #7a1a10; border-radius: 10px; }
.pd2-cards .ncard-act .checkin-btn { order: 2; border: 1.5px solid #c8261f; background: #fff; color: #a3141a; }
.pd2-cards .ncard-act .route { order: 3; flex: none; min-height: 2.35rem; border: 1.5px solid #e6b155; background: linear-gradient(180deg, #c8261f, #8e0d12); color: #fff; font-size: .9rem; }
.pd2-cards .ncard-act:not(:has(.route)) .checkin-btn { grid-column: 1 / -1; }
.pd2-cards .ncard-act .btn .ic, .pd2-cards .ncard-act .btn svg { width: 1rem; height: 1rem; flex: none; }
.pd2-cards .ncard-act .btn .t { overflow: hidden; text-overflow: ellipsis; }

/* ===== 1.8.3: người đã check-in — dòng tóm tắt trên thẻ + cửa sổ danh sách ===== */
.ckw-line { display: flex; align-items: center; gap: .45rem; width: 100%; min-width: 0; margin: .15rem 0; padding: .38rem .55rem; border: 1.5px solid #ecd39d; border-radius: 12px;
  background: #fff8ea; color: #5a2a10; font: inherit; font-size: .84rem; line-height: 1.2; text-align: left; cursor: pointer; }
button.ckw-line:hover { border-color: #c8261f; background: #fff1d6; }
button.ckw-line:focus-visible { outline: 3px solid #f2b84b; outline-offset: 2px; }
.ckw-line.none { cursor: default; color: #9a7a55; background: #fffcf5; border-style: dashed; }
.ckw-ic { font-size: 1rem; }
.ckw-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ckw-txt b { color: #a3141a; }
.ckw-txt em { font-style: normal; font-weight: 800; color: #a3141a; }
.ckw-go { flex: none; font-size: 1.25rem; font-weight: 800; color: #c8261f; line-height: 1; }
.ckw-avs { display: inline-flex; flex: none; }
.ckw-avs .ckw-av { width: 1.55rem; height: 1.55rem; font-size: .72rem; border: 2px solid #fff8ea; }
.ckw-avs .ckw-av + .ckw-av { margin-left: -.45rem; }
.ckw-av { display: inline-grid; place-items: center; flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; font-weight: 800; color: #fff; background: #c8261f; }
.ckw-av.a1 { background: #b7791f; }
.ckw-av.a2 { background: #7a1a10; }
.pd2-cards .ckw-line.pc { width: auto; margin: auto .55rem 0; }
.pd2-cards .ckw-line.pc + .pl-stats { margin-top: .45rem; padding-top: 0; border-top: 0; }
.hmc .ckw-line.hm { width: auto; margin: 0 .3rem .1rem; }
.ckw-line.pd { margin: 0 0 .7rem; font-size: .92rem; padding: .5rem .7rem; }
/* cửa sổ */
.ckw-modal .modal-body { display: grid; gap: .6rem; }
.ckw-head { display: grid; gap: .35rem; padding: .6rem .75rem; border-radius: 12px; background: linear-gradient(180deg, #fff8ea, #fdeecf); border: 1.5px solid #ecd39d; }
.ckw-head > b { color: #7a1a10; font-size: 1.02rem; }
.ckw-sum { display: flex; flex-wrap: wrap; gap: .4rem; }
.ckw-sum span { padding: .2rem .6rem; border-radius: 999px; background: #fff; border: 1px solid #e9cf98; font-size: .86rem; color: #5a2a10; }
.ckw-sum span b { color: #c8261f; }
.ckw-search { width: 100%; }
.ckw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: min(55vh, 28rem); overflow-y: auto; }
.ckw-row { display: grid; grid-template-columns: 1.6rem auto minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .45rem .55rem; border-radius: 12px; background: #fffdf8; border: 1px solid #f0e0bd; }
.ckw-row.top { background: #fff6e2; border-color: #e9c47a; }
.ckw-no { text-align: center; font-weight: 800; color: #9a7a55; font-size: .85rem; }
.ckw-row.top .ckw-no { color: #c8261f; }
.ckw-who { display: grid; min-width: 0; }
.ckw-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3a1d0b; }
.ckw-who small { color: #8a6a45; font-size: .78rem; }
.ckw-n { display: inline-flex; align-items: baseline; gap: .2rem; padding: .2rem .6rem; border-radius: 999px; background: #c8261f; color: #fff; }
.ckw-n b { font-size: 1rem; }
.ckw-n small { font-size: .75rem; opacity: .9; }
.ckw-note { margin: 0; }
/* 1.8.4: nút Người đã check-in ở đầu mục Check-in tại đây */
.ckw-hbtns { gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.ckw-hbtn .ckw-hcnt { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: #c8261f; color: #fff; font-size: .85rem; }
.ckw-sumlink { font-weight: 800; color: #a3141a; text-decoration: underline; text-underline-offset: 2px; }
/* 1.8.6: thẻ check-in ở trang địa danh bấm mở cửa sổ đọc */
.ck2.ck2-pop { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.ck2.ck2-pop:hover { border-color: #c8261f; box-shadow: 0 4px 14px rgba(160, 40, 20, .16); }
.ck2.ck2-pop .ks-acts { cursor: default; }

/* ===== 1.8.7: số thứ tự trên các điểm "Theo dòng thời gian" + 2 nút Zalo ở Trang chủ ===== */
.kp-dot.kp-no { display: inline-grid; place-items: center; left: -.82rem; top: .7rem; width: 1.42rem; height: 1.42rem; padding: 0; box-sizing: border-box;
  background: #b3161d; border: 2px solid #fff; box-shadow: 0 0 0 2px #b3161d, 0 2px 5px rgba(120, 20, 10, .3); color: #fff; font: 800 .72rem/1 system-ui, sans-serif; z-index: 1; }
.kp-dot.kp-no.w2 { width: 1.6rem; left: -.9rem; border-radius: 999px; }
.kp-dot.kp-no.w3 { width: 2rem; left: -1.1rem; border-radius: 999px; font-size: .66rem; }
.kp-item.on .kp-dot.kp-no, .kp-item:hover .kp-dot.kp-no { background: #e9b34f; color: #5a1a08; box-shadow: 0 0 0 2px #b3161d; }
.zl-fab { position: fixed; z-index: 23; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; pointer-events: none; }
.zl-fab > * { pointer-events: auto; }
body.kp-is-an .zl-fab { bottom: calc(16px + 3.5rem); }
body.kp-is-mo .zl-fab { right: calc(min(400px, 100vw - 32px) + 28px); }
body.kp-is-to .zl-fab { display: none; }
.zl-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .3rem 1.05rem .3rem .45rem; border-radius: 999px; border: 2px solid #9cc4ff;
  background: linear-gradient(180deg, #1a7bff, #0058d6); color: #fff; font: inherit; font-weight: 800; font-size: .95rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 70, 170, .32); transition: transform .12s, box-shadow .12s; }
.zl-btn:hover, .zl-btn:focus-visible { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 70, 170, .4); color: #fff; }
.zl-btn:focus-visible { outline: 3px solid #f2b84b; outline-offset: 2px; }
.zl-btn .brand-z { width: 1.85rem; height: 1.85rem; border-radius: 50%; background: #fff; color: #0068ff; font-size: 1rem; }
.zl-btn.off { background: #eef3fb; color: #3b5a86; border: 2px dashed #9cb4d6; box-shadow: none; font-weight: 700; font-size: .85rem; }
.zl-set { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1.5px solid #e2c48a; background: #fffaf0; color: #7a1a10; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 6px rgba(80, 40, 10, .18); }
.zl-row { border: 1.5px solid #f0d9ae; border-radius: 12px; padding: .5rem .8rem .2rem; margin: 0 0 .7rem; }
.zl-row legend { font-weight: 800; color: #a3141a; padding: 0 .3rem; }
@media (max-width: 599px) {
  .zl-fab { right: 10px; bottom: calc(var(--bnav-h, 4.4rem) + 10px + env(safe-area-inset-bottom)); }
  body.kp-is-an .zl-fab { bottom: calc(var(--bnav-h, 4.4rem) + 10px + 3.5rem + env(safe-area-inset-bottom)); }
  body.kp-is-mo .zl-fab { display: none; }
  .zl-btn { min-height: 2.5rem; font-size: .88rem; padding-right: .85rem; }
  .zl-btn .brand-z { width: 1.6rem; height: 1.6rem; }
}
@media print { .zl-fab { display: none; } }

/* ===== 1.8.8: chân trang website ===== */
.site-foot { max-width: 1100px; margin: 1.5rem auto 0; padding: 1rem 1rem 1.4rem; text-align: center; color: #5a2a10; animation: none; }
.site-foot .sf-orn { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-bottom: .55rem; color: #c8961f; }
.site-foot .sf-orn span { flex: 0 1 9rem; height: 1.5px; background: linear-gradient(90deg, transparent, #d9a84a, transparent); }
.site-foot .sf-orn i { font-style: normal; font-size: 1.05rem; }
.site-foot .sf-t { display: block; font-family: var(--gp-serif); font-size: 1.12rem; font-weight: 800; color: #a3141a; letter-spacing: .01em; }
.site-foot .sf-s { margin: .3rem auto 0; max-width: 46rem; font-size: .95rem; font-weight: 600; line-height: 1.45; color: #6b3a14; }
.site-foot .sf-c { display: block; margin-top: .45rem; font-size: .8rem; color: #9a7a55; }
.main[data-view="cay"] > .site-foot, html.tree-fs .site-foot { display: none; }
@media (max-width: 599px) { .site-foot { padding: .8rem .9rem 1.2rem; } .site-foot .sf-t { font-size: 1rem; } .site-foot .sf-s { font-size: .86rem; } }
@media (max-width: 599px) { .main[data-view="home"] > .site-foot { padding-bottom: 4.6rem; } body:has(#zaloFab) .main[data-view="home"] > .site-foot { padding-bottom: 10.5rem; } }
/* 1.8.9: thẻ Lịch sử check-in bấm mở cửa sổ đọc */
.ksc2.ckc.ck2-pop { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.ksc2.ckc.ck2-pop:hover { border-color: #c8261f; box-shadow: 0 6px 16px rgba(160, 40, 20, .18); }

/* ===== 1.9.0: băng "Trang chủ" — vệt sáng gợn sóng lướt qua mỗi ~5 giây ===== */
@media (min-width: 600px) {
  .gnav-head::after { content: ''; position: absolute; z-index: 2; top: -20%; bottom: -20%; left: 0; width: 45%; pointer-events: none;
    background: linear-gradient(100deg, rgba(255,240,200,0) 0%, rgba(255,240,200,.08) 30%, rgba(255,248,225,.55) 50%, rgba(255,240,200,.08) 70%, rgba(255,240,200,0) 100%);
    -webkit-mask: radial-gradient(60% 55% at 50% 50%, #000 55%, transparent 100%); mask: radial-gradient(60% 55% at 50% 50%, #000 55%, transparent 100%);
    transform: translateX(-120%) skewX(-18deg); animation: gnavSweep 5s ease-in-out infinite; }
  .gnav-head .gnav-tree, .gnav-head .gnav-pagoda { animation: gnavBob 5s ease-in-out infinite; }
  .gnav-head .gnav-pagoda { animation-delay: .25s; }
}
@keyframes gnavSweep { 0%, 62% { transform: translateX(-120%) skewX(-18deg); opacity: 0; } 66% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(330%) skewX(-18deg); opacity: 0; } }
@keyframes gnavBob { 0%, 62%, 100% { transform: translateY(0); } 76% { transform: translateY(-2px); } 88% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .gnav-head::after { display: none; } .gnav-head .gnav-tree, .gnav-head .gnav-pagoda { animation: none; } }
.kp-who { display: block; margin-top: .15rem; font-size: .82rem; color: #7a4a1a; }
.kp-who b { color: #a3141a; }
.site-foot .sf-s + .sf-s { margin-top: .15rem; }
.site-foot .sf-add { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin: .45rem auto 0; border-radius: 50%; border: 1.5px dashed #c8961f; background: #fffaf0; color: #a3141a; font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.site-foot .sf-add:hover { background: #fdeccd; border-style: solid; }
.sf-rows { display: grid; gap: .45rem; margin-bottom: .6rem; }
.sf-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto auto; gap: .35rem; align-items: center; }
.sf-no { font-weight: 800; color: #a3141a; text-align: right; }

/* 1.9.1 Vợ / chồng trên cây: A ô cạnh nhau · B ghi trong thẻ · C nhóm con theo cặp */
.vc-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3em; margin-left: .15em; }
.vc-chip { position: relative; display: inline-flex; align-items: center; gap: .3em; padding: .3em .7em; margin-left: .55em; border: 1.5px solid #c2477a; border-radius: 10px;
  background: #fde6ee; color: #7a1f45; font-weight: 700; font-size: .85em; cursor: pointer; min-height: 2.2em; }
.vc-chip::before { content: ""; position: absolute; left: -.6em; top: 50%; width: .55em; border-top: 2px solid #c2477a; }
.vc-chip + .vc-chip::before { border-top-style: dashed; }
.vc-chip.dead { background: #ede1e5; color: #5d3a48; }
.vc-chip.sel { outline: 3px solid var(--brand); }
.vc-chip:hover, .vc-head:not(:disabled):hover { background: #fbd3e1; }
.vc-hrt { color: #c2477a; }
.vc-num { flex: none; display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; background: #c2477a; color: #fff; font-size: .72em; font-weight: 800; }
.vc-grp > .trow { padding: .15em 0; }
.vc-head { display: inline-flex; align-items: center; gap: .4em; padding: .3em .8em; border: 1.5px dashed #c2477a; border-radius: 10px; background: #fff5f8;
  color: #7a1f45; font-weight: 700; font-size: .88em; cursor: pointer; }
.vc-head small { color: #9b6a80; font-weight: 600; }
.vc-head.none { cursor: default; font-style: italic; opacity: .85; }
.vc-head.dead { background: #f3eaed; }
.tkids > .vc-grp > .tkids { border-left-color: #e3a3bd; }
.pado .pn.vc { cursor: pointer; }
@media (max-width: 599px) {
  .trow:has(> .vc-chips) { flex-wrap: wrap; }
  .trow > .vc-chips { flex-basis: 100%; flex-direction: column; align-items: flex-start; padding-left: 3.4em; margin: -.1em 0 .2em; }
}

/* 1.9.4 Tải bản in khổ lớn A0 / A1 / A2 */
.pr-box { margin-top: 1rem; padding: .9rem 1rem; border: 1.5px solid #e2c48a; border-radius: 14px; background: #fffaf0; }
.pr-box h4 { margin: 0 0 .6rem; color: #a3141a; font-size: 1.05rem; }
.pr-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .45rem 0; }
.pr-lab { min-width: 5.5rem; font-weight: 700; color: #5a3b22; }
.pr-seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.pr-opt { min-height: 2.6rem; padding: .35rem .8rem; border: 1.5px solid #e2c48a; border-radius: 10px; background: #fff; color: #5a3b22; font-weight: 600; cursor: pointer; }
.pr-opt.on { background: #a3141a; border-color: #a3141a; color: #fff; }
.pr-info { margin: .5rem 0; }
.pr-bar { height: 8px; border-radius: 4px; background: #f1e3c4; overflow: hidden; margin: .4rem 0; }
.pr-bar > span { display: block; height: 100%; width: 0; background: #a3141a; transition: width .2s; }

/* ===== 2.0.0: Quản lý tài khoản & phân quyền ===== */
.ql-lv { display: inline-block; padding: .08rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 800; border: 1.5px solid; white-space: nowrap; }
.ql-lv.l0 { color: #6b5a48; border-color: #cdbda5; background: #f7f1e6; }
.ql-lv.l1 { color: #1f5f8a; border-color: #9cc3df; background: #eaf4fb; }
.ql-lv.l2 { color: #1f6b2a; border-color: #8fca97; background: #ebf8ed; }
.ql-lv.l3 { color: #fff; border-color: #8e0d12; background: linear-gradient(180deg, #c8261f, #8e0d12); }
.ql-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .45rem .9rem; margin-bottom: .5rem; }
.ql-legend.sm { margin-bottom: .8rem; font-size: .9rem; }
.ql-lg { display: flex; align-items: center; gap: .5rem; }
.ql-lg .ql-lv { min-width: 5.6rem; text-align: center; }
.ql-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.ql-q { flex: 1 1 260px; min-height: 2.8rem; border: 2px solid #ecc874; border-radius: 14px; padding: 0 .9rem; background: #fffdf8; font-size: 1rem; }
.ql-flt { display: flex; gap: .35rem; flex-wrap: wrap; }
.ql-f { border: 1.5px solid #e2c27e; background: #fffaf0; color: #7a4a1e; border-radius: 999px; padding: .35rem .85rem; font-weight: 700; cursor: pointer; }
.ql-f.on { background: #c8261f; border-color: #8e0d12; color: #fff; }
.ql-list { display: grid; gap: .7rem; }
.ql-card { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .8rem 1rem; border: 2px solid #ecc874; border-radius: 16px; background: rgba(255,250,240,.96); box-shadow: 0 3px 10px rgba(150,90,20,.1); }
.ql-card.locked { opacity: .72; background: #f4efe7; }
.ql-av { width: 2.8rem; height: 2.8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #fff; background: linear-gradient(180deg, #c8261f, #8e0d12); border: 2px solid #e6b155; }
.ql-name { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: 1.08rem; }
.ql-tag { font-size: .78rem; font-weight: 800; padding: .05rem .5rem; border-radius: 999px; background: #f3e6cc; color: #7a4a1e; }
.ql-tag.qt { background: #fde9a8; color: #8a5a00; }
.ql-tag.me { background: #e3f0ff; color: #1f5f8a; }
.ql-tag.lock { background: #f6dada; color: #a3141a; }
.ql-meta { margin-top: .2rem; color: #6b4a32; font-size: .92rem; }
.ql-acts { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.ql-acts .btn.danger { color: #a3141a; }
.ql-sec { margin: 0 0 1rem; }
.ql-sec h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; color: #a3141a; font-size: 1.05rem; }
.ql-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .5rem .6rem; border-bottom: 1px dashed #ead9b4; }
.ql-row.own { background: #fff6dc; border-radius: 10px; }
.ql-nm { flex: 1 1 240px; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.ql-eff { flex-basis: 100%; color: #8a6a45; }
.ql-c { display: flex; flex-direction: column; gap: .1rem; }
.ql-c small, .ql-kt small { color: #8a6a45; }
.ql-sel { min-height: 2.4rem; border: 1.5px solid #d9b56a; border-radius: 10px; background: #fffdf8; padding: 0 .4rem; font-size: .95rem; }
.ql-kt { display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.ql-kt input { width: 1.2rem; height: 1.2rem; }
.ql-mine .ql-mrow { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; border-bottom: 1px dashed #ead9b4; }
.ql-mine .ql-mrow > span:first-child { flex: 1; }
@media (max-width: 640px) {
  .ql-card { grid-template-columns: auto 1fr; }
  .ql-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .ql-c { flex: 1 1 45%; }
  .ql-sel { width: 100%; }
}
.ql-row.qtr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: end; }
.ql-row.qtr .ql-nm { align-self: center; }
@media (max-width: 760px) {
  .ql-row.qtr { grid-template-columns: 1fr 1fr; }
  .ql-row.qtr .ql-nm, .ql-row.qtr .ql-kt { grid-column: 1 / -1; }
}
.ql-sel { max-width: 13rem; }
.ql-perm, .ql-sec { min-width: 0; max-width: 100%; }
.ql-row.qtr > * { min-width: 0; }
.ql-row .ql-nm { min-width: 0; }
.ql-eff { display: block; width: 100%; min-width: 0; overflow-wrap: anywhere; }

/* ===== 2.0.1: mật khẩu ===== */
.pw-wrap { position: relative; display: flex; align-items: stretch; }
.pw-wrap > input { flex: 1; min-width: 0; padding-right: 4.2rem; }
.pw-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 1.5px solid #e2c27e; background: #fffaf0; color: #7a4a1e; border-radius: 10px; padding: .25rem .6rem; font-weight: 700; font-size: .85rem; cursor: pointer; }
.ql-pwrow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .4rem; }
.ql-un { color: #7a4a1e; }
.ql-un.none { color: #a07a50; font-style: italic; font-weight: 400; }
.ql-cred { font-family: inherit; white-space: pre-wrap; background: #fff8e8; border: 1.5px dashed #d9b56a; border-radius: 12px; padding: .8rem 1rem; font-size: 1rem; line-height: 1.6; user-select: all; }

/* ===== 2.0.2: Ma trận phân quyền ===== */
.ql-tabs { display: flex; gap: 6px; margin: 0 0 12px; background: #fffaf0; border-radius: 10px 10px 0 0; padding: 0 6px; position: relative; z-index: 1; border-bottom: 1px solid var(--line, #e3d6c0); }
.ql-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted, #7a6a55); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.ql-tab.on { color: var(--red, #9b1c1c); border-bottom-color: var(--red, #9b1c1c); }
.ql-tab .pf-i { width: 18px; height: 18px; }
.qm-bar { flex-wrap: wrap; align-items: center; }
.qm-sp { flex: 1; }
.qm-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line, #e3d6c0); border-radius: 10px; background: #fff; }
.qm-t { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.qm-t th, .qm-t td { border-bottom: 1px solid #eee3d0; padding: 4px 5px; text-align: center; white-space: nowrap; background: #fff; }
.qm-t thead th { position: sticky; top: 0; z-index: 2; background: #faf4e8; }
.qm-t thead tr:nth-child(2) th { top: 31px; }
.qm-t .qm-u { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 170px; max-width: 220px; white-space: normal; border-right: 2px solid #e3d6c0; }
.qm-t thead .qm-u { z-index: 3; }
.qm-t .g { border-left: 1px solid #e3d6c0; }
.qm-gh { font-size: 13px; font-weight: 700; color: var(--red, #9b1c1c); }
.qm-colbtn { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 4px; border-radius: 6px; max-width: 120px; white-space: normal; line-height: 1.2; }
.qm-colbtn:hover { background: #f0e4cc; }
.qm-colbtn .pf-i { width: 16px; height: 16px; }
.qm-ch.tt .qm-colbtn { font-weight: 400; font-style: italic; color: #7a6a55; }
.qm-tn { white-space: pre-wrap; }
.qm-un { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.qm-def { margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.qm-sel { font: inherit; font-size: 12px; padding: 3px 2px; border-radius: 6px; border: 1px solid #d8c8ab; min-width: 86px; cursor: pointer; }
.qm-sel.inh { opacity: .62; border-style: dashed; font-style: italic; background: #fff; }
.qm-sel.own { font-weight: 700; }
.qm-sel.own.l0 { background: #eef0f3; } .qm-sel.own.l1 { background: #e5f2ff; } .qm-sel.own.l2 { background: #e6f5e6; } .qm-sel.own.l3 { background: #fde8d8; border-color: #e0915a; }
.qm-sel.inh.l2 { color: #2e6b2e; } .qm-sel.inh.l3 { color: #a14d14; }
.qm-t tr.locked th, .qm-t tr.locked td { opacity: .55; }
.qm-t tr.dirty .qm-u { box-shadow: inset 4px 0 0 #e0a100; background: #fff8e0; }
.qm-all { color: #a14d14; font-weight: 600; background: #fdf3ea !important; }
.qm-sum th, .qm-sum td { position: sticky; background: #faf4e8; font-weight: 600; }
.qm-sum:first-child th, .qm-sum:first-child td { bottom: 26px; } .qm-sum:last-child th, .qm-sum:last-child td { bottom: 0; }
.qm-sum th.qm-u { z-index: 3; font-size: 12px; }
.qm-sum td.has { color: #a14d14; }
.qm-empty { padding: 18px !important; color: #7a6a55; }
@media (max-width: 760px) { .qm-t .qm-u { min-width: 130px; max-width: 150px; } .qm-sel { min-width: 74px; } .qm-wrap { max-height: 64vh; } }

/* ===== 2.0.3: Không được xem · trạng thái hiển thị gia phả · thu gọn nhánh con ===== */
.ql-lv.l-1 { color: #fff; border-color: #3b3b3b; background: repeating-linear-gradient(135deg, #555 0 6px, #444 6px 12px); }
.qm-sel.own.l-1 { background: #e2e2e2; color: #222; border-color: #555; }
.qm-sel.inh.l-1 { color: #555; }
.qm-sum.an td.has { color: #333; }
.ht-ic { font-size: .82em; line-height: 1; margin-left: .15rem; cursor: help; }
.nav-sub-item .ht-ic { flex: 0 0 auto; opacity: .9; }
.ql-row.qtr { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.ql-row.qtr.an { background: repeating-linear-gradient(135deg, #f4f1ec 0 10px, #ece7df 10px 20px); border-radius: 10px; }
.ql-row.qtr.an b { text-decoration: line-through; text-decoration-color: #9a9a9a; }
.ql-row.qtr.root { border-top: 2px solid #ead9b4; }
.ql-fold { width: 1.7rem; height: 1.7rem; flex: 0 0 auto; display: inline-grid; place-items: center; border: 1px solid #d8c398; border-radius: 6px; background: #fffaf0; color: #8e0d12; font-size: .95rem; cursor: pointer; padding: 0; }
.ql-fold:hover { background: #fdeccc; }
.ql-fold.sp { border: 0; background: none; color: #b39a72; cursor: default; }
.ql-sum { flex-basis: 100%; color: #a3141a; font-weight: 600; }
.ql-kt.take { flex-basis: 100%; margin-top: .15rem; }
.ql-kt.take small { color: #1f6b2a; font-weight: 700; }
.ql-mode .ql-sel { max-width: 15rem; }
.ql-mode-na { max-width: 11rem; display: block; line-height: 1.25; }
.ql-sec-h { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: space-between; }
.ql-sec-h h3 { margin: 0; }
.ql-folds { display: flex; gap: .4rem; flex-wrap: wrap; }
.ql-hint { margin: .35rem 0 .5rem; }
.ht-chip { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-weight: 700; font-size: .85rem; border: 1.5px solid; white-space: nowrap; }
.ht-chip.cong_khai, .ht-row.cong_khai .ht-sel { color: #1f6b2a; border-color: #8fca97; background: #ebf8ed; }
.ht-chip.thanh_vien, .ht-row.thanh_vien .ht-sel { color: #1f5f8a; border-color: #9cc3df; background: #eaf4fb; }
.ht-chip.quan_tri, .ht-row.quan_tri .ht-sel { color: #8e0d12; border-color: #e0a0a0; background: #fdeeee; }
.ht-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.ht-row.root { border-top: 2px solid #ead9b4; }
.ht-sel { font-weight: 700; }
@media (max-width: 760px) {
  .ql-row.qtr { grid-template-columns: 1fr 1fr; }
  .ql-row.qtr .ql-mode { grid-column: 1 / -1; }
  .ql-mode .ql-sel { max-width: none; width: 100%; }
}
.ql-row.qtr .ql-nm > b, .ht-row .ql-nm > b { flex: 1 1 0; min-width: 7rem; }
.ql-lg .ql-lv.l-1 { min-width: 7.6rem; }
.modal .ql-legend.sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem .8rem; }
.modal .ql-legend.sm .ql-lg { display: flex; align-items: center; gap: .5rem; }

/* ===== 2.0.4: Danh sách tài khoản theo mẫu · phân loại khu vực / tỉnh / nhánh · duyệt đăng ký ===== */
.qa-top, .qa-quick { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem .8rem; background: #fffaf1; border: 1px solid #f0dfc0; border-radius: 22px; box-shadow: 0 4px 14px rgba(150, 90, 20, .08); padding: .8rem 1rem; margin-bottom: .8rem; }
.qa-search { flex: 1 1 260px; display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid #f0e2c8; border-radius: 16px; padding: 0 .9rem; min-height: 3rem; box-shadow: inset 0 1px 3px rgba(0,0,0,.04); }
.qa-sic { font-size: 1.4rem; color: #5a3b25; line-height: 1; transform: scaleX(-1); }
.qa-q { flex: 1; border: 0 !important; outline: none; background: transparent; font: inherit; font-size: 1.05rem; min-width: 0; padding: .55rem 0; box-shadow: none !important; }
.qa-q::placeholder { color: #a58a6c; font-style: italic; }
.qa-sep { width: 1px; align-self: stretch; background: #ead6b4; }
.qa-st { display: flex; flex-wrap: wrap; gap: .5rem; }
.qa-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid transparent; border-radius: 14px; padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer; min-height: 2.6rem; }
.qa-chip small { font-weight: 700; font-size: .78rem; background: rgba(255,255,255,.75); border-radius: 999px; padding: 0 .45rem; }
.qa-chip .qa-ic { font-size: 1rem; }
.qa-chip.all { background: #e4f1fb; color: #1f5f8a; border-color: #c6e0f2; }
.qa-chip.ok { background: #e9f6df; color: #2c6b1f; border-color: #cbe7b6; }
.qa-chip.wait { background: #fdeccf; color: #a5560c; border-color: #f6d39a; }
.qa-chip.no { background: #fde6e2; color: #b42318; border-color: #f5c3ba; }
.qa-chip.on { outline: 2.5px solid currentColor; outline-offset: 1px; }
.qa-go { display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 16px; padding: .7rem 1.5rem; font: inherit; font-weight: 700; font-size: 1.05rem; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #c9302c, #9b1414); box-shadow: 0 6px 14px rgba(155, 20, 20, .3); min-height: 3rem; }
.qa-go span { font-size: 1.3rem; transform: scaleX(-1); }
.qa-ql { display: inline-flex; align-items: center; gap: .35rem; color: #3b2415; }
.qa-ql span { color: #8a5a2b; }
.qa-quick-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.qa-pill { border: 1px solid #ecd6b0; background: #fff4e2; border-radius: 999px; padding: .45rem 1rem; font: inherit; color: #4a2c17; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; }
.qa-pill small { color: #a5560c; font-weight: 700; }
.qa-pill.on { background: #9b1414; color: #fff; border-color: #9b1414; }
.qa-pill.on small { color: #ffe1a8; }
.qa-morebtn { border: 0; background: none; font: inherit; color: #8a5a2b; cursor: pointer; padding: .3rem .2rem; }
.qa-sp { flex: 1; }
.qa-reset { border: 1.5px solid #d9bf96; background: #fff; border-radius: 14px; padding: .5rem 1.1rem; font: inherit; font-weight: 600; color: #4a2c17; cursor: pointer; }
.qa-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem .9rem; background: #fffaf1; border: 1px dashed #e4cda5; border-radius: 16px; padding: .8rem 1rem; margin: -.3rem 0 .8rem; }
.qa-more[hidden] { display: none; }
.qa-fl { display: flex; flex-direction: column; gap: .2rem; }
.qa-fl small { color: #8a6a48; font-weight: 600; }
.qa-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.qa-stat { color: #8a6a48; font-weight: 600; }
.qa-list { display: flex; flex-direction: column; gap: .8rem; }
.qa-grp { display: flex; flex-direction: column; gap: .7rem; }
.qa-gh { margin: .6rem 0 0; color: #8e0d12; font-size: 1.1rem; display: flex; gap: .6rem; align-items: baseline; border-bottom: 2px solid #ecd6b0; padding-bottom: .3rem; }
.qa-gh small { color: #8a6a48; font-weight: 600; font-size: .85rem; }
.qa-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.2rem; background: #fffaf1; border: 1px solid #f0dfc0; border-radius: 22px; padding: 1rem 1.2rem; box-shadow: 0 4px 14px rgba(150, 90, 20, .07); }
.qa-card.cho_duyet { border-color: #f3c98a; background: #fffaf0; }
.qa-card.tu_choi { opacity: .85; }
.qa-card.locked .qa-main { opacity: .6; }
.qa-no { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.3rem; background: radial-gradient(circle at 35% 30%, #d0423a, #8e0d12); box-shadow: 0 3px 8px rgba(142, 13, 18, .35); }
.qa-main { min-width: 0; }
.qa-name { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; }
.qa-name b { font-size: 1.3rem; color: #3b2415; }
.qa-tag { font-size: .85rem; font-weight: 600; border-radius: 999px; padding: .15rem .7rem; border: 1px solid; white-space: nowrap; }
.qa-tag.tv { background: #e4f1fb; color: #1f5f8a; border-color: #c6e0f2; }
.qa-tag.qt { background: #fde8d8; color: #a14d14; border-color: #f0bf98; }
.qa-tag.wait { background: #fdeccf; color: #a5560c; border-color: #f6d39a; }
.qa-tag.no { background: #fde6e2; color: #b42318; border-color: #f5c3ba; }
.qa-tag.me { background: #f1ecff; color: #5b3fb0; border-color: #d6cbf7; }
.qa-tag.lock { background: #eee; color: #444; border-color: #ccc; }
.qa-star { color: #f0a500; font-size: 1.35rem; line-height: 1; }
.qa-place, .pl-line { display: flex; flex-wrap: wrap; gap: .2rem .9rem; color: #6b5040; margin-top: .25rem; font-size: 1rem; }
.pl-goc { color: #6b5040; }
.pl-none { color: #b39a7a; font-style: italic; }
.qa-meta { color: #8a6a48; font-size: .88rem; margin-top: .25rem; }
.qa-note { font-size: .9rem; color: #6b5040; margin-top: .25rem; }
.qa-note.no { color: #b42318; }
.qa-acts { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; border-left: 1px solid #ead6b4; padding-left: 1.2rem; }
.qa-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid #e2c9a0; background: #fff; border-radius: 14px; padding: .55rem 1.1rem; font: inherit; font-weight: 600; color: #3b2415; cursor: pointer; min-height: 2.7rem; white-space: nowrap; }
.qa-btn:hover { background: #fff4e2; }
.qa-btn.perm, .qa-btn.ok { border-color: #a9d68f; background: #f0f9ea; color: #2c6b1f; }
.qa-btn.del { border-color: #f0b4a9; background: #fff2f0; color: #b42318; }
.qa-btn.ghost { border-style: dashed; color: #6b5040; }
.qa-kv { display: grid; grid-template-columns: 9rem 1fr; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed #ecd6b0; }
.qa-kv span { color: #8a6a48; }
.qa-reg { margin-right: .4rem; }
.qm-pl { color: #8a5a2b; margin-top: 2px; }
.pl-box { border: 1px solid #ecd6b0; border-radius: 12px; padding: .6rem .8rem .2rem; margin: .4rem 0 .8rem; background: #fffaf1; }
.pl-box legend { font-weight: 700; color: #8e0d12; padding: 0 .3rem; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .2rem .8rem; }
.pl-f select { width: 100%; }
.reg-cta { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed #e4cda5; }
.me2-pl { font-size: .95rem; }
@media (max-width: 760px) {
  .qa-top, .qa-quick { border-radius: 16px; padding: .7rem; }
  .qa-sep { display: none; }
  .qa-go { flex: 1 1 100%; justify-content: center; }
  .qa-chip { padding: .45rem .7rem; }
  .qa-card { grid-template-columns: auto minmax(0, 1fr); padding: .8rem; gap: .6rem .8rem; }
  .qa-no { width: 2.4rem; height: 2.4rem; font-size: 1.05rem; }
  .qa-acts { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid #ead6b4; padding-top: .6rem; justify-content: stretch; }
  .qa-acts .qa-btn { flex: 1 1 auto; justify-content: center; padding: .5rem .6rem; }
  .qa-name b { font-size: 1.15rem; }
}
.qa-sic { transform: none; display: inline-flex; }
.qa-sic svg, .qa-go svg { width: 1.3rem; height: 1.3rem; }
.qa-search { flex: 1 1 200px; }
.qa-chip { padding: .45rem .75rem; }
.qa-go { padding: .65rem 1.2rem; }
.qa-quick-list { flex: 0 1 auto; }
@media (min-width: 1200px) { .qa-top { flex-wrap: nowrap; } .qa-st { flex-wrap: nowrap; } }

/* ===== 2.0.5: Ký sự — lưới 5 bài / hàng trên màn hình rộng (theo bề rộng khung, không theo cửa sổ) ===== */
.ks2-box:has(.ks5-grid), .ck-list:has(.ks5-grid) { container-type: inline-size; }
@container (min-width: 760px) { .ks5-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1040px) { .ks5-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; } }
@container (min-width: 1300px) { .ks5-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; } }
@container (min-width: 0px) {
  .ks5-grid > .ks-item { padding: .45rem .45rem .6rem; }
  .ks5-grid .ksc2-t { font-size: 1.02rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .ks5-grid .ksc2-line { font-size: .84rem; }
  .ks5-grid .ksc2-line .ki:nth-of-type(2) { margin-left: .3rem; }
  .ks5-grid .ksc2-sum { font-size: .86rem; }
  .ks5-grid .ksc2-badge { font-size: .8rem; padding: .1rem .55rem; }
  .ks5-grid .ksc2-pic.none > .ki { width: 3rem; height: 2.6rem; }
  .ks5-grid .ks-acts { gap: .25rem; padding-top: .5rem; }
  .ks5-grid .ks-acts .btn.sm { min-height: 2rem; padding: .05rem .45rem; font-size: .8rem; gap: .2rem; }
  .ks5-grid .ks-acts .btn.sm .ki, .ks5-grid .ks-acts .sh2-b .ic { width: .9rem; height: .9rem; }
  .ks5-grid .ks-acts .sh2 { display: contents; }
  .ks5-grid .ks-acts .btn.sm.sh2-b { min-height: 2rem; padding: .05rem .45rem; font-size: .8rem; gap: .2rem; }
}
/* 2.0.5: check-in dùng chung lưới 5 cột; viền nổi khi rê chuột bao cả thẻ lẫn hàng nút cho cân đối */
.ks5-grid > .ks-item:has(.ck2-pop) { transition: box-shadow .15s, border-color .15s; }
.ks5-grid > .ks-item:has(.ck2-pop):hover { border-color: #c8261f; box-shadow: 0 6px 16px rgba(160, 40, 20, .18); }
.ks5-grid .ksc2.ckc.ck2-pop:hover { border-color: transparent; box-shadow: none; }
.ks5-grid .ksc2-sum:empty { display: none; }
.ks5-grid .ks-acts { width: 100%; }
.ckc-who { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.ks5-grid .ckc-who .ckc-u.pf-i { margin-left: .35rem; }
.ks5-grid .ck2-place { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .86rem; line-height: 1.35; }
.ks5-grid .ck2-place > * { display: inline; }
.ks5-grid .ck2-place .pf-i { display: inline-block; width: .95rem; height: .95rem; vertical-align: -.15em; margin-right: .2rem; color: #c8261f; }
.ksc2-pic:has(.new-tag) .ksc-star { top: 2.6rem; }
/* 2.0.7: thẻ Ký sự / Địa danh ở Trang chủ và trang Địa danh nền trắng */
.hmc { background: #fff; }
.hmc .hmc-in { background: #fff; }
.pd2-cards .ncard { background: #fff; }
/* nhãn "Mới" không đè nhãn "Tiêu biểu" */
.hmc-pic:has(.new-tag) .hmc-badge { top: 2.6rem; }
/* 2.0.8: menu trái — tên mục dài (Địa danh nổi tiếng Mai tộc) xuống 2 dòng thay vì cắt "…" */
@media (min-width: 900px) {
  .gnav .nav-item.gsect:not(.nv-home) { height: auto; min-height: 3rem; padding-top: .35rem; padding-bottom: .35rem; }
  .gnav .nav-item.gsect:not(.nv-home) > span:not(.gn-cnt):not(.badge) { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.22; }
}

/* ===== 2.0.9: Thanh đầu trang "Kết nối dòng tộc" (máy tính ≥ 1100px): băng logo + khẩu hiệu + tranh cổng đình, thanh menu đỏ, hàng menu phụ ===== */
.brand img { border-radius: 50%; background: #fff; object-fit: cover; }
.hd-ban, .hd-menu, .hd-sub { display: none; }
.hd-i { display: inline-flex; width: 1.25rem; height: 1.25rem; flex: none; }
.hd-i svg { width: 100%; height: 100%; display: block; }
@media (min-width: 1100px) {
  .shell { --top-h: 14.4rem; }
  html[data-view="cay"]:not(.tree-fs) .shell { --top-h: 8.35rem; }
  html.nav-off .shell { --nav-w: 0px; }
  html.nav-off .nav, html.nav-off .nav-grip { display: none !important; }
  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 6.6rem 3.9rem 3.9rem;
    grid-template-areas: "ban ban ban" "menu search voice" "sub sub sub"; align-items: center; gap: 0 .6rem;
    padding: 0 1.1rem 0; color: #3a1d0b; position: relative; border-bottom: 1px solid #f0dcb0;
    background: linear-gradient(90deg, #fdf3df, rgba(253, 243, 223, 0) 9rem) right top / 43.6rem 6.6rem no-repeat, url("../img/hd/canh.jpg") right top / auto 6.6rem no-repeat, linear-gradient(180deg, #fffaf0 0, #fdf0d8 6.6rem, #fffaf3 6.6rem, #fdf6ea 100%);
  }
  html[data-view="cay"] .topbar { grid-template-rows: .55rem 3.9rem 3.9rem; background: linear-gradient(180deg, #fffaf3, #fdf6ea); }
  html[data-view="cay"] .hd-ban, html[data-view="cay"] .topbar > .top-ticker { display: none !important; }
  .topbar .brand { display: none; }
  /* băng logo */
  .hd-ban { grid-area: ban; display: flex; align-items: center; gap: 1.2rem; min-width: 0; height: 100%; padding-left: .4rem; }
  .hd-logo { flex: none; display: block; width: 6rem; height: 6rem; border-radius: 50%; padding: 3px;
    background: linear-gradient(145deg, #f7d77e, #c98a22 55%, #f3cf6d); box-shadow: 0 4px 12px rgba(120, 60, 10, .35); }
  .hd-logo img { width: 100%; height: 100%; border-radius: 50%; display: block; background: #fff; }
  .hd-tt { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
  .hd-tt b { font-size: 2.05rem; line-height: 1.1; font-weight: 800; color: #a3141a; letter-spacing: -.01em; white-space: nowrap; text-shadow: 0 1px 0 #fff; }
  .hd-tt i { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; color: #6b2a0e; white-space: nowrap; }
  .hd-tt small { font-size: .82rem; color: #8a5a2b; white-space: nowrap; }
  .topbar .top-ticker { grid-area: ban; justify-self: end; align-self: end; margin: 0 0 .45rem; width: min(44%, 40rem); height: 2.1rem; font-size: .88rem;
    background: rgba(122, 12, 16, .82); color: #fff; box-shadow: 0 2px 8px rgba(80, 20, 0, .25); }
  /* thanh menu đỏ */
  .topbar::before { content: ""; grid-area: 2 / 1 / 3 / -1; align-self: stretch; margin: 0 -.5rem; border-radius: 999px; z-index: 0;
    background: linear-gradient(180deg, #cf2a1e 0, #a5141a 55%, #860c10 100%); border: 2px solid #e6b155; box-shadow: 0 3px 10px rgba(120, 20, 10, .35), inset 0 1px 0 rgba(255, 220, 160, .45); }
  .hd-menu { grid-area: menu; display: flex; align-items: center; gap: .35rem; min-width: 0; padding-left: .9rem; z-index: 1; overflow: hidden; }
  .hd-mi { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1.15rem; border-radius: 999px; color: #fff; font-weight: 800; font-size: 1.06rem;
    text-decoration: none; white-space: nowrap; transition: background .15s; }
  .hd-mi .hd-i { width: 1.35rem; height: 1.35rem; }
  .hd-mi:hover:not(.on) { background: rgba(255, 255, 255, .14); }
  .hd-mi.on { background: linear-gradient(180deg, #fff0c2, #f3c55c); color: #7a1a10; box-shadow: inset 0 -2px 0 rgba(160, 90, 10, .3), 0 2px 6px rgba(60, 10, 0, .3); }
  .hd-sep { flex: none; width: 2px; height: 1.6rem; border-radius: 2px; background: rgba(255, 222, 150, .75); }
  .topbar .top-search { grid-area: search; z-index: 1; width: clamp(13rem, 21vw, 23rem); height: 2.75rem; background: #fff; color: #6b5440; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); }
  .topbar #open-voice { grid-area: voice; z-index: 1; width: 2.9rem; height: 2.9rem; min-width: 0; padding: 0; margin-right: .3rem; border-radius: 50%;
    background: linear-gradient(180deg, #f6d27a, #d0901f); color: #fff; box-shadow: 0 2px 6px rgba(60, 10, 0, .35); }
  /* hàng menu phụ */
  .hd-sub { grid-area: sub; display: flex; align-items: center; gap: .55rem; min-width: 0; margin: .5rem 0 .35rem; padding: .3rem .45rem; height: 3.05rem;
    background: #fffdf8; border: 1px solid #f0dcb0; border-radius: 18px; box-shadow: 0 2px 8px rgba(150, 90, 20, .1); overflow: hidden; }
  .hd-tree-w { display: flex; align-items: center; gap: .5rem; flex: 0 1 auto; min-width: 0; max-width: 26rem; height: 100%; padding: 0 .9rem 0 .3rem;
    border-radius: 999px; background: linear-gradient(180deg, #fff3da, #fbe5bb); }
  .hd-tog { flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0;
    background: #c8261f; color: #fff; font-size: 1.25rem; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(120, 10, 10, .4); }
  .hd-tree { display: flex; align-items: center; gap: .4rem; min-width: 0; color: #a3141a; text-decoration: none; }
  .hd-tree .tr { width: 1.45rem; height: 1.45rem; }
  .hd-tree b { font-size: 1.05rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .hd-tree .cv { width: .95rem; height: .95rem; color: #a3141a; }
  .hd-tree small { flex: none; color: #7a4a1d; font-size: .9rem; font-weight: 600; white-space: nowrap; }
  .hd-tree:hover b, .hd-tree.on b { text-decoration: underline; text-underline-offset: 3px; }
  .hd-sb { flex: none; display: inline-flex; align-items: center; gap: .45rem; height: 2.35rem; padding: 0 1.05rem; border-radius: 999px;
    background: linear-gradient(180deg, #fffaf0, #fcecc9); border: 1px solid #f0d49b; color: #a3141a; font-weight: 700; font-size: .98rem; text-decoration: none; white-space: nowrap; }
  .hd-sb:hover { border-color: #c8261f; }
  .hd-sb.on { background: linear-gradient(180deg, #c8261f, #8e0d12); border-color: #8e0d12; color: #fff; }
  .hd-sb .hd-i { width: 1.2rem; height: 1.2rem; }
  .hs-sukien .hd-i { color: #e0261c; }
  .hs-sukien.on .hd-i { color: #ffd463; }
  .hd-sep2 { flex: none; width: 2px; height: 1.5rem; border-radius: 2px; background: #e8c98a; }
  .hd-fill { flex: 1 1 0; }
}
@media (min-width: 1100px) and (max-width: 1399px) {
  .hd-mi { padding: .45rem .75rem; font-size: .98rem; gap: .4rem; }
  .hd-menu { gap: .15rem; padding-left: .4rem; }
  .topbar .top-search { width: clamp(11rem, 18vw, 16rem); }
  .topbar .top-search span { overflow: hidden; text-overflow: ellipsis; }
  .hd-tt b { font-size: 1.75rem; }
  .hd-sb { padding: 0 .75rem; font-size: .93rem; }
  .hd-tree-w { max-width: 18rem; }
}

/* ===== 2.0.9: trang Giới thiệu / Tính năng / Kết nối / Liên hệ / Thư viện ảnh ===== */
.tg-page .pf-body { display: flex; flex-direction: column; gap: 1rem; }
.tg-head { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; border-radius: 18px; color: #fff;
  background: linear-gradient(100deg, #860c10, #b51d1a 55%, #c8471f); border: 2px solid #e6b155; box-shadow: 0 4px 14px rgba(120, 20, 10, .25); }
.tg-head h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.tg-head p { margin: .15rem 0 0; opacity: .92; }
.tg-hic { flex: none; width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #fff0c2, #f3c55c); color: #8e0d12; }
.tg-hic .hd-i { width: 1.7rem; height: 1.7rem; }
.tg-card { background: #fff; border: 1.5px solid #f0dcb0; border-radius: 18px; padding: 1rem 1.15rem; box-shadow: 0 3px 10px rgba(150, 90, 20, .1); min-width: 0; }
.tg-card h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1.2rem; color: #a3141a; }
.tg-card h2 .hd-i { width: 1.4rem; height: 1.4rem; }
.tg-card p { margin: .3rem 0 .6rem; line-height: 1.55; }
.tg-intro { display: flex; gap: 1.3rem; align-items: flex-start; }
.tg-logo { flex: none; width: 9rem; height: 9rem; border-radius: 50%; border: 3px solid #e6b155; box-shadow: 0 4px 12px rgba(120, 60, 10, .25); background: #fff; }
.tg-text { flex: 1; min-width: 0; position: relative; }
.tg-text .prose { font-size: 1.05rem; line-height: 1.65; }
.tg-edit { margin-top: .5rem; }
.tg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .8rem; }
.tg-stat { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .9rem .6rem; background: #fff; border: 1.5px solid #f0dcb0; border-radius: 16px; text-align: center; color: #7a4a1d; }
.tg-stat .hd-i { width: 1.8rem; height: 1.8rem; color: #c8261f; }
.tg-stat b { font-size: 1.6rem; color: #a3141a; line-height: 1.1; }
.tg-btns { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.tg-btns.center { justify-content: center; }
.tg-btns .btn { gap: .45rem; }
.tg-btns .btn .hd-i { width: 1.2rem; height: 1.2rem; }
.tg-zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
.tg-zalo .brand-z { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #fff; color: #0068ff; font: 800 .85rem/1 system-ui, sans-serif; }
.tg-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.tg-grid2 .tg-wide { grid-column: 1 / -1; }
.tg-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.tg-feat { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; background: #fff; border: 1.5px solid #f0dcb0; border-radius: 18px; color: #3a1d0b; text-decoration: none;
  box-shadow: 0 3px 10px rgba(150, 90, 20, .1); transition: border-color .15s, transform .15s; }
.tg-feat:hover { border-color: #c8261f; transform: translateY(-2px); }
.tg-feat b { font-size: 1.15rem; color: #a3141a; }
.tg-feat p { margin: 0; flex: 1; line-height: 1.5; color: #5a3a20; }
.tg-fic { width: 3rem; height: 3rem; border-radius: 14px; display: grid; place-items: center; background: #fdf0d6; color: #c8261f; }
.tg-fic .hd-i { width: 1.7rem; height: 1.7rem; }
.tg-go { font-weight: 700; color: #c8261f; }
.tv-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: .9rem; }
.tv-it { margin: 0; background: #fff; border: 1.5px solid #f0dcb0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(150, 90, 20, .1); }
.tv-pic { position: relative; display: block; padding: 0; border: 0; background: #f4e6c8; aspect-ratio: 4 / 3; cursor: zoom-in; }
.tv-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tv-pic:hover img { transform: scale(1.04); }
.tv-tag { position: absolute; left: .45rem; top: .45rem; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(255, 250, 240, .92); color: #7a1a10; }
.tv-tag.t-checkin { color: #0b6b3a; }
.tv-tag.t-diadanh { color: #8a4a00; }
.tv-it figcaption { padding: .45rem .65rem .55rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tv-it figcaption a { color: #a3141a; font-weight: 700; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.tv-it figcaption small { color: #8a6a4a; }
.tv-empty { padding: 2rem; text-align: center; }
@media (max-width: 599px) {
  .tg-intro { flex-direction: column; align-items: center; }
  .tg-logo { width: 7rem; height: 7rem; }
  .tg-head h1 { font-size: 1.3rem; }
  .tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
}
/* 2.0.10: biểu tượng cây mai "Gia Phả Họ Mai" thay cho biểu tượng Gia phả và các cụm / nhãn cây */
.mai-ic { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.gn-i:has(.mai-ic), .hd-i:has(.mai-ic) { color: inherit; }
.gnav .nav-item.nv-cay .gn-i.ic { width: 2.1rem; height: 2.1rem; margin: -.25rem -.15rem; }
.gnav .gn-bush { width: 1.45rem; height: 1.45rem; }
.bnav .nav-item .gn-i.ic { width: 1.9rem; height: 1.9rem; }
.hd-tree .tr { width: 1.7rem; height: 1.7rem; }

/* ===== 2.0.12: hàng menu phụ — đồng hồ âm lịch thay ô gia phả; chữ chạy lễ giỗ nằm giữa Thư viện và Tin nổi bật ===== */
@media (min-width: 1100px) {
  .hd-lam { flex: none; display: flex; align-items: center; gap: .6rem; height: 100%; padding: 0 1rem 0 .35rem; border-radius: 999px; min-width: 0;
    background: linear-gradient(180deg, #fff3da, #fbe5bb); color: #7a1a10; cursor: default; }
  .lam-ic { flex: none; width: 2.05rem; height: 2.05rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.25rem; line-height: 1;
    background: linear-gradient(180deg, #c8261f, #8e0d12); color: #ffd463; box-shadow: 0 1px 3px rgba(120, 10, 10, .4); }
  .lam-t, .lam-d { display: flex; flex-direction: column; line-height: 1.12; white-space: nowrap; }
  .lam-t { padding-right: .6rem; border-right: 2px solid #e8c98a; align-items: center; }
  .lam-t b { font-size: 1.12rem; font-weight: 800; color: #a3141a; font-variant-numeric: tabular-nums; }
  .lam-t small, .lam-d small { font-size: .76rem; color: #8a5a2b; font-weight: 600; }
  .lam-d b { font-size: .98rem; font-weight: 800; color: #a3141a; }
  .lam-d b::first-letter { text-transform: uppercase; }
  .hd-fill { display: flex; align-items: center; min-width: 0; height: 100%; padding: 0 .2rem; }
  .hd-sub .top-ticker { grid-area: auto; justify-self: auto; align-self: auto; flex: 1 1 auto; width: auto; margin: 0; height: 2.35rem; font-size: .9rem;
    background: linear-gradient(180deg, #8e0d12, #6d0a0e); color: #fff; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3); }
}
@media (min-width: 1100px) and (max-width: 1399px) {
  .lam-dl { display: none; }
  .hd-lam { padding-right: .7rem; gap: .45rem; }
}

/* ===== 2.0.13 ===== */
/* băng đầu menu trái: "Kết nối gia phả họ Mai" (máy tính); máy tính bảng vẫn "Trang chủ" */
.nv-long { display: none; }
@media (min-width: 1100px) {
  .nv-long { display: inline; }
  .nv-short { display: none; }
  .gnav-head .nav-item .nv-long { display: inline-block; max-width: 8.6rem; white-space: normal; line-height: 1.18; font-size: 1rem; text-shadow: 0 1px 2px rgba(60, 0, 0, .6); }
  /* bỏ đường dẫn "🏠 › …" ở các trang danh sách (trang chi tiết có nút quay lại thì vẫn giữ) */
  .pf-crumb:not(:has(.pf-back)) { visibility: hidden; }
  .pf-top:not(:has(.pf-back)):not(:has(.pf-right)) { display: none; }
}
/* khẩu hiệu trên thanh đầu: font có đủ dấu tiếng Việt (Georgia trên Windows thiếu dấu ố, ồ, ế…) */
.hd-tt i { font-family: var(--gp-serif, "Noto Serif", "Times New Roman", serif) !important; }
/* nút +/− của các nhãn nhóm gia phả: xanh lá chuối đậm */
.nav-grp-head .nav-tog, .gnav .nav-grp-head .nav-tog.sm { background: #2f7d1e; border-color: #2f7d1e; color: #fff; }
.nav-grp-head[aria-expanded="false"] .nav-tog, .gnav .nav-grp-head[aria-expanded="false"] .nav-tog.sm { background: #3f8f22; border-color: #2a6e1a; color: #fff; }
.nav-grp-head .nav-tog:hover { background: #24661a; }
/* Thư viện ảnh: 5 ảnh / hàng, khung ảnh cùng tỉ lệ */
.tg-thuvien .pf-body { container-type: inline-size; }
.tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 560px) { .tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 820px) { .tv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 1040px) { .tv-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tv-it { min-width: 0; }
.tv-pic { position: relative; overflow: hidden; aspect-ratio: 4 / 3; height: auto; min-height: 0; width: 100%; }
.tv-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tv-it figcaption { flex: 1; }

/* ===== 2.0.14 ===== */
/* font thư pháp Dancing Script (OFL, có dấu tiếng Việt) — tự lưu trên host, không gọi Google Fonts */
@font-face { font-family: "GP Thu Phap"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/dancing-script-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: "GP Thu Phap"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/dancing-script-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "GP Thu Phap"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/dancing-script-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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@media (min-width: 1100px) {
  /* băng đầu menu trái: "Kết nối gia phả họ Mai" chữ thư pháp, một hàng */
  .gnav-head .nav-item .nv-long { display: inline; max-width: none; white-space: nowrap; font-family: "GP Thu Phap", "Segoe Script", cursive;
    font-weight: 700; font-size: 1.42rem; line-height: 1.1; letter-spacing: .01em; color: #fff3c4; text-shadow: 0 1px 0 #7a0c10, 0 2px 6px rgba(60, 0, 0, .55); }
  .gnav-head .nav-item { overflow: visible; }
  .gnav-head .gp-art { opacity: .55; }
  /* Ký sự họ Mai, Lịch sử check-in, Hội - Lễ - Giỗ chạp đã lên thanh menu ngang → ẩn ở menu trái */
  .gnav .nv-gio, .gnav .nv-kysu, .gnav .ks-sub { display: none !important; }
  .sb-short { display: none; }
  .hs-checkin .hd-i { color: #c8261f; }
  .hs-checkin.on .hd-i, .hs-gio.on .hd-i { color: #ffd463; }
}
@media (min-width: 1100px) and (max-width: 1499px) {
  .sb-long { display: none; }
  .sb-short { display: inline; }
}
/* Hội - Lễ - Giỗ chạp: bộ lọc và các nút trên thẻ nhỏ gọn hơn */
.gpg-filters.card { padding: .6rem 1rem .7rem; }
.gpg-filters .f-row + .f-row { margin-top: .35rem; }
.gpg-filters .f-lbl { font-size: .95rem; margin-bottom: .25rem; }
.gpg-filters .fchips { gap: .35rem; }
.gpg-filters .fchip { min-height: 2.1rem; padding: 0 .75rem; font-size: .9rem; gap: .35rem; border-width: 1px; }
.gpg-filters .fchip .n { min-width: 1.45rem; height: 1.45rem; font-size: .78rem; padding: 0 .35rem; }
.gio-page .gc .gc-acts { gap: .3rem; }
.gio-page .gc .gc-row2 { gap: .3rem .35rem; margin-top: .3rem; }
.gio-page .gc .gc-acts .btn, .gio-page .gc .gc-acts a.btn, .gio-page .gc .gc-acts button,
.gio-page .gc .gc-row2 .btn, .gio-page .gc .gc-row2 button, .gio-page .gc .gc-row2 label, .gio-page .gc .gc-info {
  min-height: 1.95rem !important; height: auto; padding: .1rem .6rem !important; font-size: .8rem !important; gap: .3rem; border-radius: 999px; }
.gio-page .gc .gc-acts .ic, .gio-page .gc .gc-row2 .ic, .gio-page .gc .gc-acts .brand-z, .gio-page .gc .gc-acts .brand-f { width: 1rem; height: 1rem; font-size: .7rem; }
.gio-page .gc .gc-row2 input[type="checkbox"] { width: 1rem; height: 1rem; }
.gio-page .gc { cursor: pointer; }
@media (min-width: 1100px) and (max-width: 1799px) { .lam-dl { display: none; } }

/* ===== 2.0.15 ===== */
/* chấm trước tên cây / nhánh ở menu trái: xanh lá chuối đậm */
.gnav .nav-sub-item .dot, .nav-sub-item .dot { background: #2f7d1e; }
.gnav .nav-sub-item.branch .dot, .nav-sub-item.branch .dot { background: #2f7d1e; border-color: #2f7d1e; }
/* đồng hồ âm lịch: nền trắng, chữ xanh */
@media (min-width: 1100px) {
  .hd-lam { background: #fff; border: 1px solid #cfe3c4; color: #23661a; }
  .lam-ic { background: linear-gradient(180deg, #3f8f22, #23661a); color: #fff; }
  .lam-t { border-right-color: #cfe3c4; }
  .lam-t b, .lam-d b { color: #23661a; }
  .lam-t small, .lam-d small { color: #4f7f3c; }
}
/* Thư viện: ngày + lượt xem (bấm mở cửa sổ đọc bài) */
.tv-meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.tv-view { border: 0; background: none; padding: .1rem .2rem; cursor: pointer; color: #7a5a3a; font-size: .8rem; border-radius: 6px; }
.tv-view:hover { background: #fdf0d6; color: #a3141a; }
.tv-view .views { display: inline-flex; align-items: center; gap: .25rem; }
.tv-view .ic { width: 1rem; height: 1rem; }

/* ===== 2.0.16: Xem dọc gọn hơn ===== */
/* lớp .sub dùng chung (khối phụ có viền trên + đệm .8rem) lọt vào thẻ người → thẻ cao gấp đôi; trả về dòng phụ thường */
.pcard .sub { padding: 0; border-top: 0; margin-top: .05em; line-height: 1.2; }
.tree .pcard { min-height: 2.35em; padding: .15em .75em .15em .25em; gap: .45em; box-shadow: 0 1px 3px rgba(80, 40, 10, .1); }
.tree .pcard .avatar { width: 1.9em; height: 1.9em; font-size: .8em; }
.tree .pcard .nm { line-height: 1.2; }
.tree .pcard .spec-tag { line-height: 1.2; }
.tree .trow { gap: .3em; padding: .08em 0; }
.tree .tog { width: 1.75em; height: 1.75em; font-size: .85em; border-width: 1.5px; }
.tree .node-more { width: 1.85rem; height: 1.85rem; border-width: 1.5px; }
.tree .node-more .ic { width: .95rem; height: .95rem; }
.tree .tkids { margin-left: .95em; padding-left: .6em; border-left-width: 2px; }
.tree .tkids > .tnode::before { left: -.6em; top: 1.2em; width: .55em; border-top-width: 2px; }
.tree .tkids > .tnode:last-child::after { left: calc(-.6em - 2px); top: 1.25em; width: 2px; }
.tree .vc-num { font-size: .66em; }
.tree .code { font-size: .78em; }

/* ===== 2.0.18: thông báo dự án đang phát triển (khách chưa đăng nhập) ===== */
.dev-wrap { display: grid; place-items: center; min-height: 70vh; padding: 1.5rem 1rem; }
.dev-card { width: min(100%, 34rem); text-align: center; background: #fffdf8; border: 2px solid #e6b155; border-radius: 22px; padding: 1.8rem 1.6rem 1.5rem;
  box-shadow: 0 10px 30px rgba(120, 40, 10, .15); }
.dev-logo { width: 8.5rem; height: 8.5rem; border-radius: 50%; border: 3px solid #e6b155; background: #fff; box-shadow: 0 4px 12px rgba(120, 60, 10, .2); }
.dev-card h1 { margin: .8rem 0 .1rem; color: #a3141a; font-size: 1.9rem; }
.dev-slogan { margin: 0 0 1rem; font-family: "GP Thu Phap", "Noto Serif", serif; font-size: 1.35rem; color: #6b2a0e; }
.dev-msg { background: linear-gradient(180deg, #fff3da, #fbe5bb); border-radius: 16px; padding: 1rem 1.1rem; color: #4a2a10; }
.dev-msg b { display: block; font-size: 1.2rem; color: #8e0d12; margin-bottom: .35rem; }
.dev-msg p { margin: .3rem 0; line-height: 1.55; font-size: 1.05rem; }
.dev-thank { font-style: italic; color: #7a4a1d; }
.dev-btns { margin-top: 1.1rem; display: flex; justify-content: center; }
.dev-login { margin-top: 1rem; text-align: left; }
html.dev-lock .nav, html.dev-lock .nav-grip, html.dev-lock .bnav, html.dev-lock .hd-menu, html.dev-lock .hd-sub, html.dev-lock .top-search, html.dev-lock #open-voice, html.dev-lock .top-ticker { display: none !important; }
html.dev-lock .shell { --nav-w: 0px; }
@media (min-width: 1100px) { html.dev-lock .shell { --top-h: 7rem; } html.dev-lock .topbar { grid-template-rows: 6.6rem 0 0; } html.dev-lock .topbar::before { display: none; } }

/* ===== 2.0.19: thanh công cụ trang Gia phả gọn 3 hàng ===== */
.tb3 { padding: 0 !important; overflow: visible; border-radius: 14px; background: #fff; border: 1px solid #f0dcb0; box-shadow: 0 2px 8px rgba(150, 90, 20, .08); }
.tb3 .tree-pick { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .55rem .9rem; margin: 0; border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #fff7e8, #fdf0d8); border: 0; border-bottom: 1px solid #f0dcb0; box-shadow: none; min-height: 0; }
.tb3 .tree-pick .tb2-tree { width: 1.35rem; height: 1.2rem; color: #c8261f; flex: none; }
.tb3 .tp-sel, .tb3 .tp-name { display: flex; flex-direction: column; gap: 0; min-width: 0; background: none; border: 0; padding: 0; }
.tb3 .tp-lbl { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #b4532a; }
.tb3 .tp-sel select { border: 0; background: transparent; padding: 0 1.2rem 0 0; font-size: 1.08rem; font-weight: 700; color: #2b1a0e; min-height: 0; height: auto; box-shadow: none; max-width: 32rem; }
.tb3 .tp-name b { font-size: 1.08rem; color: #2b1a0e; }
.tb3 .tp-role { font-size: .8rem; padding: .15rem .6rem; }
.tb3 .tp-cnt { flex: none; padding: .2rem .7rem; border-radius: 999px; background: #e3f3dc; color: #2f7d1e; font-weight: 700; font-size: .85rem; }
.tb3 .tree-pick .btn.sm { min-height: 2.1rem; padding: 0 1rem; font-size: .9rem; border-radius: 999px; }
.tb3 .tp-new { background: #ef3e36; border-color: #ef3e36; color: #fff; }
.tb3 .tp-new:hover { background: #d42f28; }
.tb3 .tp-edit { background: #fff; border: 1.5px solid #e2cfae; color: #7a5a3a; }
.tb3 .tree-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .4rem; padding: .5rem .9rem; margin: 0; background: none; border: 0; box-shadow: none; min-height: 0; }
.tb3 .tb3-r2 { border-bottom: 1px solid #f3e6cc; }
.tb3 .spacer { flex: 1 1 auto; }
/* kiểu xem: chip nhỏ */
.tb3.tb2 .tree-bar .seg { display: flex; flex-wrap: wrap; gap: .3rem; background: none; border: 0; padding: 0; box-shadow: none; }
.tb3.tb2 .tree-bar .seg > button { min-height: 1.95rem; height: auto; padding: 0 .75rem; border-radius: 999px; border: 0; background: #f1ece4; color: #3a2a1c;
  font-size: .9rem; font-weight: 600; gap: .3rem; box-shadow: none; }
.tb3.tb2 .tree-bar .seg > button .tb2-ti { display: none; }
.tb3.tb2 .tree-bar .seg > button:hover { background: #ebe1d1; }
.tb3.tb2 .tree-bar .seg > button.on { background: #fde0dc; color: #c8261f; font-weight: 700; }
.tb3.tb2 .tree-bar .seg > button.on::before { content: "★"; margin-right: .1rem; font-size: .85em; }
.tb3.tb2 .tree-bar .seg > .cat-tab.on::before { content: none; }
.tb3.tb2 .tree-bar .seg > .cat-tab { background: #fde9d6; color: #b4532a; }
/* ô chọn dạng nút "Bố cục ▾" */
.tb3-dd { position: relative; display: inline-flex; align-items: center; gap: .3rem; min-height: 1.95rem; padding: 0 .75rem; border-radius: 999px; background: #f1ece4;
  color: #3a2a1c; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tb3-dd:hover { background: #ebe1d1; }
.tb3-dd .dd-car { font-size: .7em; opacity: .75; }
.tb3-dd select.dd-sel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; min-height: 0; padding: 0; border: 0; }
/* hàng 3: nút bật / tắt dạng chip */
.tb3 .tb3-r3 .btn.sm { min-height: 1.95rem; height: auto; padding: 0 .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; gap: .3rem; box-shadow: none;
  background: #f1ece4; border: 1px solid transparent; color: #3a2a1c; }
.tb3 .tb3-r3 .btn.sm[aria-pressed="true"] { background: #e3f3dc; border-color: #b9dfab; color: #2f7d1e; }
.tb3 .tb3-r3 .btn.sm[aria-pressed="true"] > span[aria-hidden="true"] { display: inline-grid; place-items: center; width: 1rem; height: 1rem; border-radius: 3px; background: #2f7d1e; color: #fff; font-size: .7rem; line-height: 1; }
.tb3 .tb3-r3 .btn.sm[aria-pressed="true"] > span[aria-hidden="true"]::before { content: "✓"; }
.tb3 .tb3-r3 .btn.sm[aria-pressed="true"] > span[aria-hidden="true"] { font-size: 0; }
.tb3 .tb3-r3 .btn.sm[aria-pressed="true"] > span[aria-hidden="true"]::before { font-size: .72rem; }
.tb3 .tb3-r3 .spec-btn, .tb3 .tb3-r3 .spec-btn[aria-pressed="true"] { background: #fde9d6; border-color: #f4cfa8; color: #b4532a; }
.tb3 .tb3-r3 .spec-btn[aria-pressed="true"] > span[aria-hidden="true"] { background: none; color: #e07a1f; font-size: .9rem; width: auto; }
.tb3 .tb3-r3 .spec-btn[aria-pressed="true"] > span[aria-hidden="true"]::before { content: none; }
.tb3 .tb3-r3 .ic { width: .95rem; height: .95rem; }
/* "Thêm tùy chọn" */
.tb3-mw { position: relative; }
.tb3-more { min-height: 1.95rem; padding: 0 .8rem; border-radius: 999px; border: 0; background: #f1ece4; color: #3a2a1c; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tb3-more:hover, .tb3-more[aria-expanded="true"] { background: #ebe1d1; }
.tb3-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 60; min-width: 15rem; display: flex; flex-direction: column; gap: .15rem; padding: .4rem;
  background: #fff; border: 1px solid #ead9b9; border-radius: 14px; box-shadow: 0 10px 28px rgba(80, 40, 10, .2); }
.tb3-pop[hidden] { display: none; }
.tb3 .tb3-pop > .btn.sm { justify-content: flex-start; width: 100%; min-height: 2.3rem; border: 0; background: none; border-radius: 10px; font-size: .95rem; font-weight: 600; color: #3a2a1c; box-shadow: none; }
.tb3 .tb3-pop > .btn.sm:hover:not(:disabled) { background: #fdf0d6; }
.tb3-pop .t { display: inline !important; }
.tb3-zoom { display: flex; align-items: center; gap: .3rem; padding: .2rem .5rem .35rem; border-bottom: 1px solid #f3e6cc; margin-bottom: .15rem; }
.tb3-zoom > span { flex: 1; font-weight: 600; font-size: .95rem; color: #3a2a1c; }
.tb3-zoom .btn.sm { width: 2.1rem; min-height: 2.1rem; padding: 0; border-radius: 50%; }
@media (max-width: 699px) {
  .tb3 .tree-bar { padding: .45rem .6rem; }
  .tb3.tb2 .tree-bar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tb3.tb2 .tree-bar .seg > button { flex: none; }
  .tb3 .tb3-r2 .spacer { display: none; }
  .tb3 .tree-pick { padding: .5rem .6rem; }
}
.tb3.tb2 .tree-bar .seg { margin-right: 0; }
.tb3.tb2 .tree-bar .seg button { min-height: 1.95rem; padding: 0 .75rem; border-radius: 999px; font-size: .9rem; font-weight: 600; }
.tb3 .tp-name { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: .35rem; justify-content: start; }
.tb3 .tp-name .tp-lbl { grid-column: 1 / -1; }
.tb3 .tp-name .ic { width: .95rem; height: .95rem; color: #b4532a; }
.tb3 .tb3-pop > .btn.sm:disabled { opacity: .45; }
/* 2.0.20: bông mai thay biểu tượng nhóm người ở đầu thanh công cụ Gia phả */
.tb3 .tree-pick .tb2-tree.mai { width: 1.9rem; height: 1.9rem; }
.tb2-tree.mai svg { width: 100%; height: 100%; display: block; }
/* 2.0.21: tùy chọn hiện thẳng trên hàng 3 */
.tb3 .tb3-r3 .tb3-x.btn.sm { background: #fff; border: 1px solid #ead9b9; color: #5a3a20; }
.tb3 .tb3-r3 .tb3-x.btn.sm:hover:not(:disabled) { border-color: #c8261f; color: #a3141a; }
.tb3 .tb3-r3 .tb3-x .t { display: inline !important; }
.tb3 .tb3-r3 .tb3-zoom.tb3-x { display: inline-flex; gap: .2rem; padding: 0; border: 0; margin: 0; }
.tb3 .tb3-r3 .tb3-zoom .btn.sm { width: 1.95rem; padding: 0; justify-content: center; border-radius: 50%; }
.tb3 .tb3-r3 { gap: .3rem; }
.tb3 .tb3-r3 .btn.sm, .tb3 .tb3-r3 .tb3-dd { padding: 0 .55rem; font-size: .8rem; min-height: 1.85rem; gap: .25rem; }
.tb3 .tb3-r3 .tb3-zoom .btn.sm { width: 1.85rem; padding: 0; }
.tb3 .tb3-r3 .ic { width: .85rem; height: .85rem; }
.tb3.tb2 .tree-bar .seg button { padding: 0 .65rem; font-size: .86rem; min-height: 1.85rem; }
.tb3 .tb3-r2 { gap: .3rem; }
.tb3 .tb3-r2 .tb3-dd { padding: 0 .6rem; font-size: .84rem; min-height: 1.85rem; }
@media (max-width: 1499px) { .tb3 .tb3-r3 .tb3-x .t { display: none !important; } .tb3 .tb3-r3 .tb3-x.btn.sm { padding: 0 .5rem; } }

/* ===== 2.0.24: hàng mục Thông tin dòng họ — nút nhỏ, nền trắng ===== */
.cat-bar { gap: .35rem; margin: .1rem 0 .8rem; }
.cat-bar .cat-btn { min-height: 2.1rem; padding: .15rem .8rem; gap: .35rem; font-size: .9rem; border: 1px solid #ead9b9; background: #fff; box-shadow: none; }
.cat-bar .cat-btn:hover { background: #fff; border-color: #c8261f; }
.cat-bar .cat-btn .cat-ic { width: 1.05rem; height: 1.05rem; }
.cat-bar .cat-btn .cat-ic svg { width: 100%; height: 100%; }
.cat-bar .cat-btn.on { background: #fff; border-color: #c8261f; color: #c8261f; box-shadow: inset 0 0 0 1px #c8261f; }
.cat-bar .cat-btn.on .cat-ic { color: #c8261f; --ci-f: #f3c55c; }

/* ===== 2.0.25: xem bằng mã PIN ===== */
.dev-pin { margin: 1rem auto 0; max-width: 20rem; text-align: center; }
.dev-pin label { display: block; font-weight: 700; color: #7a1a10; margin-bottom: .4rem; }
.dev-pin-r { display: flex; gap: .45rem; }
.dev-pin-in { flex: 1; min-width: 0; text-align: center; font-size: 1.35rem; letter-spacing: .4em; padding: .35rem .6rem; border: 1.5px solid #e6b155; border-radius: 12px; background: #fff; }
.dev-pin .btn { min-width: 5rem; }
.dev-pin .errbox { margin-top: .5rem; }
.me-pin { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; background: #fff8e8; }

/* ===== 2.0.26: trang Hội - Lễ - Giỗ chạp — băng tháng, nút Thêm lễ, nhóm Giỗ Tổ - Lễ lớn sang xanh lá ===== */
.gpg-banner { background: linear-gradient(100deg, #1f5c16, #2f7d1e 45%, #4a9a2c); box-shadow: 0 4px 14px rgba(30, 80, 20, .25), inset 0 -3px 0 #f1c35e; }
.gpg-add.btn { background: linear-gradient(180deg, #3f8f22, #24661a); color: #fff; box-shadow: 0 3px 10px rgba(30, 80, 20, .3); }
.gpg-add.btn:hover { background: linear-gradient(180deg, #357d1c, #1d5714); }
.muc-tab.m-to, .gio-page .muc-tab.m-to { background: linear-gradient(180deg, #3f8f22, #24661a); border-color: #1d5714; color: #fff; }
.muc-tab.m-to .n, .gio-page .muc-tab.m-to .n { background: #ffd463; color: #1d5714; }
.muc-tab.m-to .ev-star { color: #ffd84d; }
/* 2.0.27: dải tên tháng, đầu tờ lịch, "Còn N ngày" gấp, ô tích mục đang chọn — xanh lá */
.gio-page .gm-tab { background-image: url("../img/gio/tab-trai-xanh.png"), url("../img/gio/tab-phai-xanh.png"), url("../img/gio/tab-giua-xanh.png"); }
.gc-dm, .gc-date.alt .gc-dm { background: linear-gradient(180deg, #3f8f22, #24661a); }
.gc-date b, .gc-date.alt b { color: #24661a; }
.gm-left.soon { background: linear-gradient(180deg, #3f8f22, #24661a); color: #fff; border-color: #1d5714; }
.gm-left .ic { color: #2f7d1e; }
.gm-left.soon .ic { color: #ffd463; }
.gio-page .gc .muc-tick.on { background: linear-gradient(180deg, #3f8f22, #24661a); border-color: #1d5714; color: #fff; }
.gio-page .gc .muc-tick.on .box { background: #fff; border-color: #fff; color: #24661a; }

/* ===== 2.0.28: Ký sự, Lịch sử check-in, Thư viện ảnh (và các trang dùng khung chung) phối xanh lá ===== */
.pf-rib { background: linear-gradient(180deg, #3f8f22, #1f5a14); box-shadow: 0 0 0 2px #1d5714, 0 6px 14px rgba(30, 80, 20, .3); }
.pf-rib2 { background: linear-gradient(180deg, #3f8f22, #24661a); box-shadow: 0 3px 8px rgba(30, 80, 20, .25); }
.pf-tag { color: #24661a; }
.pf-flbl { color: #24661a; }
.pf-filter.plain .pf-flbl { background: linear-gradient(180deg, #3f8f22, #24661a); }
.pf-chip.on, .pd2 .fchip.on, .tv-chips .fchip.on { border-color: #1d5714; background: linear-gradient(180deg, #3f8f22, #24661a); color: #fff; }
.tg-head { background: linear-gradient(100deg, #1f5a14, #2f7d1e 55%, #4a9a2c); box-shadow: 0 4px 14px rgba(30, 80, 20, .25); }
.tg-hic { color: #24661a; }
.pf-add.btn { background: linear-gradient(180deg, #3f8f22, #24661a); border-color: #1d5714; color: #fff; box-shadow: 0 3px 10px rgba(30, 80, 20, .3); }
.pf-add.btn:hover { background: linear-gradient(180deg, #357d1c, #1d5714); }

/* ===== 2.0.29: chế độ xem rộng ở trang Gia phả (máy tính): ẩn thanh menu trên, menu trái gom thành nút ☰ Gia phả ===== */
.wide-ctl, .wide-bd { display: none; }
@media (min-width: 1100px) {
  html.wide-on[data-view="cay"] .shell { --top-h: 0px; --nav-w: 0px; }
  html.wide-on[data-view="cay"] .topbar, html.wide-on[data-view="cay"] .nav-grip { display: none !important; }
  html.wide-on[data-view="cay"]:not(.wide-nav) .nav { display: none !important; }
  html.wide-on.wide-nav[data-view="cay"] .nav { display: block !important; position: fixed; left: 0; top: 0; bottom: 0; width: min(24rem, 86vw); z-index: 140;
    overflow: auto; background: #fffaf0; box-shadow: 6px 0 24px rgba(60, 30, 5, .3); animation: wideIn .18s ease-out; }
  html.wide-on.wide-nav[data-view="cay"] .gnav > :not(.nav-item-wrap):not(.nav-sub), html.wide-on.wide-nav[data-view="cay"] .gnav > .ks-sub { display: none !important; }
  html.wide-on.wide-nav[data-view="cay"] .gnav > .nav-item-wrap { padding-top: .6rem; }
  html.wide-on.wide-nav[data-view="cay"] .wide-bd { display: block; position: fixed; inset: 0; z-index: 130; background: rgba(40, 20, 5, .35); }
  html.wide-on[data-view="cay"] .wide-ctl { display: flex; flex-direction: column; gap: .45rem; position: fixed; left: .8rem; bottom: .9rem; z-index: 150; }
  html.wide-on.wide-nav[data-view="cay"] .wide-ctl { left: calc(min(24rem, 86vw) + .8rem); }
  .wide-b { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.7rem; padding: 0 1.1rem; border-radius: 999px; border: 2px solid #e6b155; cursor: pointer;
    font-weight: 800; font-size: .98rem; color: #fff; background: linear-gradient(180deg, #3f8f22, #24661a); box-shadow: 0 4px 12px rgba(30, 80, 20, .35); }
  .wide-b > span:first-child { font-size: 1.2rem; line-height: 1; }
  .wide-b.out-b { background: #fff; color: #24661a; border-color: #b9dfab; font-size: .9rem; min-height: 2.3rem; }
  html.wide-nav .wide-b.nav-b { background: linear-gradient(180deg, #c8261f, #8e0d12); }
}
@keyframes wideIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 1099px) { .wide-tg { display: none !important; } }
/* 2.0.30 */
@media (min-width: 1100px) { .hd-tt small#hd-lich { font-size: .9rem; font-weight: 600; color: #24661a; } }

/* ===== 2.0.35: xem bản in · tay nắm khung chỉ hiện khi rê chuột tới viền ===== */
.pv-ov { position: fixed; inset: 0; z-index: 400; background: #4a4038; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.pv-page { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pv-page svg { max-width: 100%; max-height: 100%; width: 100%; height: 100%; background: transparent; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); }
.pv-exit { position: fixed; top: .9rem; right: .9rem; z-index: 401; border: 2px solid #fff; border-radius: 999px; padding: .55rem 1.2rem; font-weight: 800; font-size: 1rem;
  color: #fff; background: rgba(160, 20, 26, .92); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); opacity: .85; }
.pv-exit:hover { opacity: 1; }
.pd-edge { opacity: 0; transition: opacity .15s; }
.pd-edges:hover .pd-edge, svg.near-edge .pd-edge, svg.edging .pd-edge { opacity: 1; }

/* ===== 2.0.36: chọn màu nền + độ hiện khung nền ===== */
.bgp { position: relative; }
.bgp-btn { border: 0; }
.bgp-dot { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid #c9b48e; }
.bgp-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 70; width: 17rem; padding: .7rem .8rem; background: #fff; border: 1px solid #ead9b9; border-radius: 14px; box-shadow: 0 10px 28px rgba(80, 40, 10, .2); }
.bgp-pop[hidden] { display: none; }
.bgp-h { font-weight: 800; font-size: .85rem; color: #7a1a10; margin: .1rem 0 .4rem; }
.bgp-sw { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; margin-bottom: .7rem; }
.bgp-c { width: 2.1rem; height: 2.1rem; border-radius: 8px; border: 1px solid #d8c6a3; cursor: pointer; padding: 0; position: relative; display: grid; place-items: center; }
.bgp-c.on { outline: 2px solid #c8261f; outline-offset: 1px; }
.bgp-any { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); font-size: 1rem; }
.bgp-any input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.bgp-op { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: #6b5440; margin-bottom: .6rem; }
.bgp-op input { flex: 1; min-width: 0; }
.bgp-op b { min-width: 2.6rem; text-align: right; color: #3a2a1c; }
/* 2.0.37: zoom trong xem bản in */
.pv-page { overflow: hidden; cursor: grab; touch-action: none; }
.pv-page.drag { cursor: grabbing; }
.pv-page svg { transform-origin: center center; }
.pv-zoom { position: fixed; right: .9rem; bottom: .9rem; z-index: 401; display: flex; align-items: center; gap: .35rem; padding: .3rem; border-radius: 999px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.pv-zb { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: #a3141a; color: #fff; font-size: 1.4rem; font-weight: 800; cursor: pointer; line-height: 1; }
.pv-zb:hover { background: #c8261f; }
.pv-pct { min-width: 3.6rem; text-align: center; color: #3a2a1c; font-size: .95rem; }
.pv-page, .pv-page * { user-select: none; -webkit-user-select: none; }
/* 2.0.38: xem bản in theo khổ giấy */
.pv-ov { padding: 4.2rem 1.2rem 1.2rem; }
.pv-page { position: relative; display: flex; align-items: center; justify-content: center; }
.pv-paper { position: relative; flex: none; transform-origin: center center; }
.pv-paper.scr svg { width: 100%; height: 100%; }
.pv-paper.sheet { background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.pv-paper.sheet svg { max-width: none; max-height: none; }
.pv-page svg { transform: none !important; }
.pv-top { position: fixed; top: .8rem; left: .9rem; right: 14rem; z-index: 401; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pv-lab { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .5rem .35rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .95); font-weight: 800; color: #7a1a10; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.pv-sel { border: 1px solid #e2cfae; border-radius: 999px; padding: .25rem .6rem; font-weight: 700; background: #fff; }
.pv-info { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: #fff; font-size: .92rem; font-weight: 600; }
.pv-info > span { background: rgba(0, 0, 0, .35); padding: .3rem .7rem; border-radius: 999px; }
.pv-hint { opacity: .85; font-weight: 500; }
.pv-q.ok { background: #2f7d1e !important; }
.pv-q.mid { background: #b8860b !important; }
.pv-q.bad { background: #b3141b !important; }
.pv-real { border: 2px solid #fff; border-radius: 999px; padding: .3rem .8rem; background: #24661a; color: #fff; font-weight: 800; cursor: pointer; }
/* 2.0.39: ô màu nhanh trong hộp sửa tiêu đề / phụ đề phả đồ */
.tx-sw{width:1.45rem;height:1.45rem;min-height:0;padding:0;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #bbb;cursor:pointer}
.tx-sw.on{box-shadow:0 0 0 2px #1f6b3a}
.tx-pk .btn{min-height:0;padding:.15rem .6rem;font-size:.85rem;border-width:1px}
.tx-pk input[type=color]{width:2.2rem;height:1.6rem;padding:0;border:1px solid #ccc;border-radius:6px}
/* 2.0.40 */
.tx-reset{min-height:0;padding:.3rem .9rem;font-size:.9rem;background:#fff;color:#1f6b3a;border:1px solid #1f6b3a}
.tx-reset:hover{background:#1f6b3a;color:#fff}
/* 2.0.45: nút Kiểu Gia phả (Bố cục, Khung nền, Kiểu viền) */
.kg-pop { width: 19rem; display: grid; gap: .55rem; }
.kg-row { display: grid; gap: .2rem; margin: 0; }
.kg-row .bgp-h { margin: 0; }
.kg-sel { width: 100%; min-height: 2.2rem; font-size: .9rem; border: 1px solid #d8c6a3; border-radius: 8px; padding: .2rem .45rem; background: #fff; }
.kg-pop select.kg-sel { width: 100% !important; max-width: none !important; position: static !important; opacity: 1 !important; }
/* 2.0.46: hộp sửa tiêu đề nổi bên phải, không che phả đồ — thay đổi hiện trực tiếp */
@media (min-width: 600px) {
  .modal-wrap.modal-side { background: transparent; pointer-events: none; justify-content: flex-end; align-items: flex-start; padding: 5.5rem 1rem 1rem; }
  .modal-wrap.modal-side .modal { pointer-events: auto; width: min(31rem, 42vw); max-height: calc(100dvh - 7rem); box-shadow: 0 14px 40px rgba(60, 30, 10, .35); }
}
/* 2.0.47: số đếm dưới các ô module Trang chủ */
.hm-tiles .tile .hm-cnt { display: inline-flex; align-items: baseline; gap: .25rem; align-self: flex-start; margin-top: .45rem; padding: .12rem .6rem; border-radius: 999px; background: #fff; border: 1px solid #ecd3a4; color: #6b4a2a; font-size: .8rem; line-height: 1.5; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hm-tiles .tile .hm-cnt .hm-cnt-n { color: #b3141b; font-size: .98rem; font-weight: 800; }
.hm-tiles .tile .hm-cnt[hidden] { display: none; }
/* ===== 2.0.48: cửa sổ "Bản tin giỗ chạp" phối xanh lá — băng đầu, nhãn Ngày kỵ / Giỗ, nút Thêm ban trị sự, nút Đóng ===== */
.modal.gp-theme.gp-green { --gr-1: #2e8b4e; --gr-2: #1f6b3a; --gr-3: #0f4a26; box-shadow: 0 0 0 4px rgba(31,107,58,.92), 0 20px 50px rgba(10,50,20,.4); }
.modal.gp-theme.gp-green .modal-head { background: radial-gradient(circle at 50% 100%, transparent 34%, rgba(255,230,150,.26) 35% 38%, transparent 39% 49%, rgba(255,230,150,.2) 50% 53%, transparent 54% 64%, rgba(255,230,150,.14) 65% 68%, transparent 69%), linear-gradient(100deg, var(--gr-3) 0%, var(--gr-2) 38%, var(--gr-1) 72%, #44a35f 100%); background-size: 42px 21px, auto; }
.modal.gp-theme.gp-green .modal-head .close-btn { background: var(--gr-3); }
.modal.gp-theme.gp-green .modal-head .close-btn:hover { background: #083818; }
.modal.gp-theme.gp-green .gp-head-tree { filter: drop-shadow(0 1px 0 rgba(0,40,10,.6)); }
.modal.gp-theme.gp-green .gp-tag.main { background: linear-gradient(180deg, var(--gr-1), var(--gr-2)); color: #fff; box-shadow: 0 2px 6px rgba(31,107,58,.3); }
.modal.gp-theme.gp-green .gp-tag.soft { background: #e3f2dc; color: #1f5a2e; border-color: #a9d39a; }
.modal.gp-theme.gp-green .gp-tag.soft .gp-star { color: #1f6b3a; }
.modal.gp-theme.gp-green .gp-main { background: linear-gradient(180deg, var(--gr-1), var(--gr-2)); border-color: #9cc77a; color: #fff; }
.modal.gp-theme.gp-green .gp-main:hover { background: linear-gradient(180deg, #339a57, var(--gr-3)); }
.modal.gp-theme.gp-green .modal-foot button.btn { background: linear-gradient(180deg, var(--gr-1), var(--gr-3)); border-color: #9cc77a; }
.modal.gp-theme.gp-green .modal-foot a.btn { color: var(--gr-2); border-color: var(--gr-2); }
.modal.gp-theme.gp-green .modal-foot a.btn:hover { background: #eef7e9; }
.modal.gp-theme.gp-green .modal-foot { border-top-color: #9cc77a; }
.modal.gp-theme.gp-green .modal-head { border-bottom-color: #9cc77a; }

/* ===== 2.0.49: phối xanh lá — khối Bản đồ gia phả theo tỉnh/TP, mọi cửa sổ đọc nhanh (giỗ, tỉnh, ký sự, check-in, địa danh) ===== */
.tt-box, .modal.gp-theme.gp-green { --gp-red: #1f6b3a; --gp-red2: #2e8b4e; --gp-dark: #0f4a26; }
.tt-box { box-shadow: 0 0 0 3px rgba(31,107,58,.85), 0 10px 30px rgba(10,50,20,.18); }
.tt-head { background: radial-gradient(circle at 50% 100%, transparent 34%, rgba(255,230,150,.24) 35% 38%, transparent 39% 49%, rgba(255,230,150,.17) 50% 53%, transparent 54%), linear-gradient(100deg, var(--gp-dark) 0%, var(--gp-red) 40%, var(--gp-red2) 75%, #44a35f 100%); background-size: 42px 21px, auto; }
.tt-head-tree { filter: drop-shadow(0 1px 0 rgba(0,40,10,.6)); }
.tt-title h3 { text-shadow: 0 2px 0 rgba(0,40,10,.55); }
.tt-kpi { background: linear-gradient(180deg, #2e8b4e, #145a2e); box-shadow: inset 0 0 0 1px rgba(255,230,170,.35), 0 3px 8px rgba(0,40,10,.3); }
.tt-pill.on { box-shadow: 0 2px 6px rgba(31,107,58,.3); }
.tt-qw:focus-within { box-shadow: 0 0 0 2px rgba(31,107,58,.15); }
.tt-vb.on { background: #e3f2dc; }
.tt-n { box-shadow: 0 2px 6px rgba(10,60,20,.3); }
button.tt-cell:hover, button.tt-cell:focus-visible { box-shadow: 0 6px 16px rgba(10,60,20,.2); }
.tt-foot { background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 60%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 30C80 6 150 44 240 26S360 8 400 22V60H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 38C80 16 160 52 250 34S370 18 400 30V60H0Z%22 fill=%22%231f6b3a%22/%3E%3Cpath d=%22M0 50C90 34 170 62 260 46S370 36 400 44V60H0Z%22 fill=%22%230f4a26%22/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.tl-open { background: linear-gradient(180deg, #2e8b4e, #0f4a26) !important; border-color: #9cc77a !important; }
.tl-open:hover, .tl-open:focus-visible { background: linear-gradient(180deg, #339a57, #083818) !important; }
.modal.gp-lotus.gp-green .modal-foot::after { background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 400 40%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0 22C60 6 120 30 200 18S330 4 400 20V40H0Z%22 fill=%22%23e6b155%22/%3E%3Cpath d=%22M0 28C70 14 130 36 210 24S340 12 400 26V40H0Z%22 fill=%22%231f6b3a%22/%3E%3C/svg%3E") bottom / 100% 100% no-repeat; }
.modal.gp-lotus.gp-green .modal-foot button.btn { background: #fff; }
.modal.gp-lotus.gp-green .modal-foot button.btn:hover { background: #eef7e9; }
/* 2.0.49: cửa sổ địa danh — 1 cột cho gọn */
.modal.pdd-pop .pdd-top { grid-template-columns: 1fr; }
.modal.pdd-pop .pop-read { padding-top: .2rem; }
/* ===== 2.0.50: cửa sổ chi tiết tính năng module Gia phả ===== */
.modal.gp-theme.gpf-pop, .modal.gpf-pop.wide { width: min(72rem, 96vw) !important; max-width: none !important; }
.modal.gpf-pop .modal-head h2 { font-size: 1.6rem; }
.gpf-lead { margin: .2rem 0 1rem; font-size: 1.02rem; color: #3a2a14; }
.gpf-diag { display: flex; flex-direction: column; align-items: center; margin: 0 auto 1.2rem; max-width: 52rem; }
.gpf-root { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.4rem; border-radius: 999px; color: #fff; font-family: "Noto Serif", Georgia, serif; font-size: 1.15rem;
  background: linear-gradient(180deg, #2e8b4e, #1f6b3a); border: 2px solid #e6b155; box-shadow: 0 3px 8px rgba(10,60,20,.25); }
.gpf-root .hm-i, .gpf-root svg { width: 1.3rem; height: 1.3rem; color: #ffe2a0; }
.gpf-lines { width: 75%; height: 1.2rem; border: 2px solid #9cc77a; border-bottom: 0; border-radius: 8px 8px 0 0; margin-top: .6rem; position: relative; }
.gpf-lines::before { content: ""; position: absolute; left: 50%; top: -.65rem; height: .65rem; border-left: 2px solid #9cc77a; }
.gpf-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; width: 100%; }
.gpf-pil { display: flex; flex-direction: column; align-items: center; text-align: center; padding: .6rem .5rem; border-radius: 12px; background: #fff; border: 1.5px solid #9cc77a; }
.gpf-pil b { font-family: "Noto Serif", Georgia, serif; color: #1f6b3a; font-size: 1.05rem; }
.gpf-pil small { color: #5a4a30; font-size: .82rem; line-height: 1.35; }
.gpf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.gpf-sec { background: #fff; border: 1.5px solid #ead9b9; border-radius: 14px; padding: .8rem 1rem .9rem; }
.gpf-sec h3 { display: flex; align-items: center; gap: .55rem; margin: 0 0 .55rem; font-family: "Noto Serif", Georgia, serif; font-size: 1.12rem; color: #1f6b3a; }
.gpf-n { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #1f6b3a; color: #fff; font-size: .9rem; font-family: inherit; flex: none; }
.gpf-sec dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .35rem .8rem; }
.gpf-sec dt { font-weight: 700; color: #4a2a10; font-size: .9rem; }
.gpf-sec dd { margin: 0; color: #3a2a14; font-size: .9rem; line-height: 1.45; }
@media (max-width: 760px) {
  .gpf-grid { grid-template-columns: 1fr; }
  .gpf-pillars { grid-template-columns: repeat(2, 1fr); }
  .gpf-lines { display: none; }
  .gpf-sec dl { grid-template-columns: 1fr; gap: .1rem; }
  .gpf-sec dd { margin-bottom: .35rem; }
}
/* ===== 2.0.52: cụm nút liên hệ — máy tính giữ như cũ; điện thoại gom vào 1 nút tròn bật / tắt ===== */
.zl-ic { display: inline-grid; place-items: center; flex: none; }
.zl-ic svg { width: 1.15rem; height: 1.15rem; }
.zl-btn > .zl-ic { width: 1.85rem; height: 1.85rem; border-radius: 50%; background: #fff; color: #0068ff; }
@media (min-width: 600px) { .zl-tl, .zl-tog { display: none !important; } }
@media (max-width: 599px) {
  .kp.kp-an { display: none !important; }   /* "Dòng thời gian" nằm trong cụm nút */
  .zl-fab, body.kp-is-an .zl-fab { right: 12px; bottom: calc(var(--bnav-h, 4.4rem) + 12px + env(safe-area-inset-bottom)); gap: .55rem; }
  .zl-fab .zl-btn, .zl-fab .zl-set { display: none; }
  body.fab-on .zl-fab .zl-btn { display: inline-flex; animation: zlIn .18s ease-out both; }
  body.fab-on .zl-fab .zl-set { display: inline-grid; place-items: center; }
  @keyframes zlIn { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
  .zl-btn, .zl-btn.off { flex-direction: row-reverse; align-items: center; gap: .5rem; padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; color: #3a1d0b; }
  .zl-btn:hover, .zl-btn:focus-visible { transform: none; box-shadow: none; color: #3a1d0b; }
  .zl-btn > .zl-ic, .zl-btn > .brand-z { width: 3rem; height: 3rem; border-radius: 50%; color: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
  .zl-btn > .zl-ic svg { width: 1.45rem; height: 1.45rem; }
  .zl-tl > .zl-ic { background: linear-gradient(180deg, #c4161c, #8f0d12); }
  .zl-hot > .zl-ic { background: linear-gradient(180deg, #2e8b4e, #1f6b3a); }
  .zl-zalo > .brand-z { background: #0068ff; color: #fff; font-size: 1.25rem; font-weight: 900; display: grid; place-items: center; }
  .zl-btn.off > .zl-ic, .zl-btn.off > .brand-z { opacity: .55; }
  .zl-tx { padding: .28rem .7rem; border-radius: 999px; background: #fff; color: #3a1d0b; font-size: .85rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
  .zl-tx[data-short] { font-size: 0; }
  .zl-tx[data-short]::before { content: attr(data-short); font-size: .85rem; }
  .zl-tog { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 2px solid #e9b34f; cursor: pointer;
    background: linear-gradient(180deg, #2e8b4e, #1f6b3a); color: #fff; box-shadow: 0 6px 16px rgba(10, 60, 20, .35); }
  .zl-tog .zl-ic svg { width: 1.6rem; height: 1.6rem; }
  body.fab-on .zl-tog { background: linear-gradient(180deg, #6b6b6b, #444); border-color: #ccc; }
}
/* 2.0.52: trang Tính năng trên điện thoại — 2 hàng, vuốt ngang */
.tg-swipe { display: none; }
@media (max-width: 599px) {
  .tg-feats { grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 80%; gap: .7rem;
    overflow-x: auto; scroll-snap-type: x mandatory; padding: .2rem .2rem .7rem; margin: 0 -.2rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .tg-feat { scroll-snap-align: start; }
  .tg-feat:hover { transform: none; }
  .tg-swipe { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .1rem 0 .4rem; font-size: .85rem; color: #6b4a2a; }
  .tg-swipe b { color: #1f6b3a; font-size: 1.1rem; }
}
/* 2.0.52: nút menu "Các tính năng khác" trong cửa sổ tính năng */
.gpf-nav { position: sticky; top: -.2rem; z-index: 4; display: flex; justify-content: flex-end; margin: -.3rem 0 .4rem; }
.gpf-mbtn { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem; padding: .3rem .9rem; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700; font-size: .9rem;
  background: #fff; color: #1f6b3a; border: 1.5px solid #9cc77a; box-shadow: 0 3px 10px rgba(10, 60, 20, .15); }
.gpf-mbtn[aria-expanded="true"] { background: #1f6b3a; color: #fff; }
.gpf-burger { font-size: 1.1rem; line-height: 1; }
.gpf-menu { position: absolute; right: 0; top: calc(100% + .35rem); width: min(20rem, 86vw); max-height: 60vh; overflow: auto; padding: .35rem; border-radius: 14px;
  background: #fff; border: 1.5px solid #cfe3c2; box-shadow: 0 12px 30px rgba(10, 50, 20, .25); }
.gpf-menu[hidden] { display: none; }
.gpf-mi { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.8rem; padding: .35rem .6rem; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .95rem; color: #3a1d0b; text-align: left; }
.gpf-mi:hover, .gpf-mi:focus-visible { background: #eef7e9; outline: none; }
.gpf-mic { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: #fdf0d2; color: #a3141a; flex: none; }
.gpf-mic svg, .gpf-mic .hm-i { width: 1.2rem; height: 1.2rem; }
@media (max-width: 599px) { .modal.gpf-pop .modal-head h2 { white-space: normal; font-size: 1.12rem; line-height: 1.25; } }
/* ===== 2.0.53: ô "Theo dòng thời gian" phối xanh lá ===== */
.kp:not(.kp-an) { border-color: #9cc77a; box-shadow: 0 14px 38px rgba(10, 60, 20, .25), 0 0 0 4px rgba(156, 199, 122, .2); }
.kp-head { background: linear-gradient(180deg, #2e8b4e, #1f6b3a); border-bottom-color: #9cc77a; }
.kp-ico { border-color: rgba(220, 245, 200, .85); }
.kp-title small { color: #dff3d2; }
.kp-btn { border-color: #b7dc9c; color: #f2fbea; }
.kp-item { border-left-color: #1f6b3a; }
.kp-item:hover, .kp-item:focus-visible, .kp-item.on { background: #eaf5e3; }
.kp-dot { border-color: #1f6b3a; box-shadow: inset 0 0 0 2.5px #fff, inset 0 0 0 10px #145a2e; }
.kp-dot.kp-no { background: #1f6b3a; box-shadow: 0 0 0 2px #1f6b3a, 0 2px 5px rgba(10, 60, 20, .3); }
.kp-item.on .kp-dot.kp-no, .kp-item:hover .kp-dot.kp-no { background: #e9b34f; color: #2a3a10; box-shadow: 0 0 0 2px #1f6b3a; }
.kp-year span { background: linear-gradient(90deg, #cfe8bf, #e6f4dc 70%, #f3faee); box-shadow: inset 0 -2px 0 rgba(31, 107, 58, .2); color: #17502b; }
.kp-foot { border-top-color: #cfe3c2; }
.kp-foot a { color: #1f6b3a; }
.kp-pill { background: linear-gradient(180deg, #2e8b4e, #1f6b3a); border-color: #9cc77a; }
/* 2.0.54: khối đầu Trang chủ trên điện thoại — gọn, ẩn dòng nguồn vị trí */
@media (max-width: 599px) {
  .hm-hero .welcome { margin-bottom: .5rem; gap: .45rem; align-items: center; }
  .hm-hero:has(> .welcome:only-of-type) { padding: .7rem .85rem; }
  .hm-hero .loc-src { display: none; }
  .hm-hero .loc-title { font-size: 1.35rem; gap: .3rem; }
  .hm-hero .loc-pin { width: 1.25rem; height: 1.25rem; }
  .hm-hero .hm-date { font-size: .8rem; margin-top: .2rem; line-height: 1.35; }
  .hm-hero .hm-date-ic { width: .95rem; height: .95rem; }
  .hm-chips { margin-left: 0; gap: .3rem; }
  .hm-chip { font-size: .78rem; padding: .15rem .5rem; min-height: 0; }
  .hm-chip .hm-i { width: .9rem; height: .9rem; }
  .hm-hero { padding: .75rem .85rem .8rem; border-radius: 16px; }
  .hm-hero .hm-pagoda { transform: scale(.7); transform-origin: top right; opacity: .6; }
}
@media (max-width: 599px) {
  .hm-hero .welcome:last-child { margin-bottom: 0; }
  .hm-chips { flex-wrap: nowrap; max-width: 100%; }
  .hm-chip { white-space: nowrap; }
  a.hm-chip { min-width: 0; overflow: hidden; }
  a.hm-chip > span:last-child, a.hm-chip { text-overflow: ellipsis; }
}
/* ===== 2.0.56: thẻ slide Giỗ Tổ - Lễ lớn theo mẫu — đếm ngược có biểu tượng, 2 nút ===== */
.slider.hero .hero-slide { border-radius: inherit; }
.slider.hero .hero-bg { filter: saturate(.9); }
.slider.hero .hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(40,15,5,.82) 0%, rgba(60,25,8,.6) 55%, rgba(60,25,8,.25) 100%); pointer-events: none; }
.slider.hero .hero-in { z-index: 1; }
.hero-in h2 { font-family: var(--gp-serif, "Noto Serif", Georgia, serif); }
.hero-in .chip.warn { background: #fff4dc; color: #7a0c10; border-color: #f2c46a; }
.hero-when, .hero-in > div:not([class]) { border-bottom: 1px solid rgba(255,230,180,.35); padding-bottom: .3rem; }
.hero-in .cd { gap: .45rem; margin-top: .5rem; }
.hero-in .cd-u { position: relative; min-width: 5.4rem; padding: .45rem .7rem .4rem 2.4rem; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,230,180,.45); backdrop-filter: blur(2px); text-align: center; }
.hero-in .cd-u::before { content: ""; position: absolute; left: .55rem; top: .7rem; width: 1.45rem; height: 1.45rem; background: #f4cf7a;
  -webkit-mask: var(--cdi) center / contain no-repeat; mask: var(--cdi) center / contain no-repeat; }
.hero-in .cd-u:nth-child(1) { --cdi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2zM5 9h14v11H5zm2 2v2h2v-2zm4 0v2h2v-2zm4 0v2h2v-2zm-8 4v2h2v-2zm4 0v2h2v-2z'/%3E%3C/svg%3E"); }
.hero-in .cd-u:nth-child(2) { --cdi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='7' r='3.5'/%3E%3Ccircle cx='5.5' cy='9' r='2.5'/%3E%3Ccircle cx='18.5' cy='9' r='2.5'/%3E%3Cpath d='M5.5 20c0-4 2.9-7 6.5-7s6.5 3 6.5 7zM.5 19c0-3 2-5.3 4.6-5.3-1 1.5-1.6 3.3-1.6 5.3zM23.5 19c0-3-2-5.3-4.6-5.3 1 1.5 1.6 3.3 1.6 5.3z'/%3E%3C/svg%3E"); }
.hero-in .cd-u:nth-child(3), .hero-in .cd-u:nth-child(4) { --cdi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2.2a7.8 7.8 0 1 1 0 15.6 7.8 7.8 0 0 1 0-15.6zM11 6v6.4l4.5 2.7 1-1.7-3.5-2.1V6z'/%3E%3C/svg%3E"); }
.hero-in .cd-u b { font-family: var(--gp-serif, "Noto Serif", Georgia, serif); font-size: 1.7rem; }
.hero-acts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.hero-go, .hero-read { display: inline-flex; align-items: center; gap: .55rem; min-height: 3.1rem; padding: .35rem 1.1rem .35rem .5rem; border-radius: 999px; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; }
.hero-go { background: linear-gradient(180deg, #d42a22, #8f0d12); color: #fff; border: 2px solid #f2c46a; box-shadow: 0 4px 12px rgba(80,10,0,.35); }
.hero-go-ic { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #fff; color: #b3141b; font-size: 1.2rem; font-weight: 900; }
.hero-read { background: #fff6e2; color: #9a1a12; border: 2px solid #f2c46a; padding-left: .8rem; }
.hero-read-ic { width: 1.6rem; height: 1.6rem; }
.hero-go:hover { filter: brightness(1.08); }
@media (max-width: 599px) {
  .hero-in .cd-u { min-width: 0; flex: 1; padding: .35rem .3rem .3rem 1.9rem; }
  .hero-in .cd-u::before { width: 1.15rem; height: 1.15rem; left: .4rem; top: .65rem; }
  .hero-in .cd-u b { font-size: 1.35rem; }
  .hero-in .cd { width: 100%; }
  .hero-acts { width: 100%; flex-wrap: nowrap; gap: .45rem; }
  .hero-go, .hero-read { flex: 1; min-width: 0; font-size: .86rem; padding: .3rem .55rem .3rem .35rem; gap: .35rem; line-height: 1.2; }
  .hero-go-ic { width: 1.7rem; height: 1.7rem; font-size: 1rem; flex: none; }
  .hero-read-ic { width: 1.3rem; height: 1.3rem; flex: none; }
}
/* 2.0.56: Lịch giỗ chạp — trang 5 sự kiện; máy tính chỉ trang đầu, điện thoại vuốt ngang */
.hm-gpos { display: none; }
.hm-gstrip > .hm-gpage + .hm-gpage { display: none; }
@media (max-width: 599px) {
  .hm-gstrip { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .hm-gstrip::-webkit-scrollbar { display: none; }
  .hm-gstrip > .hm-gpage { display: block !important; scroll-snap-align: start; min-width: 0; }
  .hm-gpos { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .45rem; font-size: .8rem; color: #6b4a2a; }
  .hm-gpos b { color: #a3141a; font-size: 1.05rem; }
  /* Ký sự dòng họ / Địa danh: 2 hàng, vuốt ngang */
  .hm-cards.hm-swipe { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 78%; gap: .65rem;
    overflow-x: auto; scroll-snap-type: x mandatory; padding: .2rem .1rem .6rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .hm-cards.hm-swipe > * { scroll-snap-align: start; min-width: 0; }
}
/* ===== 2.0.57 ===== */
/* Tiêu đề "Giỗ Tổ - Lễ lớn…": chữ có chân, vàng – đỏ ánh kim lướt qua + nhấp nháy nhẹ */
.hero-h { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; text-align: center; }
.hero-h-tx { font-family: "Noto Serif", "Times New Roman", Georgia, serif; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(90deg, #8f0d12 0%, #c8261f 30%, #f2b84b 45%, #fff2c2 50%, #f2b84b 55%, #c8261f 70%, #8f0d12 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: heroShine 3.2s linear infinite, heroBlink 2.4s ease-in-out infinite; }
@keyframes heroShine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes heroBlink { 0%, 100% { filter: drop-shadow(0 0 0 rgba(242,184,75,0)); } 50% { filter: drop-shadow(0 0 6px rgba(242,184,75,.75)); } }
@media (prefers-reduced-motion: reduce) { .hero-h-tx { animation: none; } }
@media (max-width: 599px) { .hero-h-tx { font-size: 1.12rem; } }
/* nút trên thẻ lễ: chữ không tràn */
.hero-go > span:nth-child(2), .hero-read > span:nth-child(2) { flex: 1; min-width: 0; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.hero-go, .hero-read { overflow: hidden; }
@media (max-width: 599px) {
  .hero-go, .hero-read { min-height: 3rem; font-size: .82rem; }
  .hero-go > span:last-child, .hero-read > span:last-child { flex: none; }
}
/* Lịch giỗ chạp: hé trang sau, chấm trang, mũi tên "Vuốt ››" nhún nhảy */
@media (max-width: 599px) {
  .hm-gstrip { grid-auto-columns: 92%; }
  .hm-gpos { gap: .6rem; }
  .hm-gdots { display: inline-flex; gap: .3rem; }
  .hm-gdots i { width: .5rem; height: .5rem; border-radius: 999px; background: #e3c99a; cursor: pointer; transition: width .2s, background .2s; }
  .hm-gdots i.on { width: 1.3rem; background: #a3141a; }
  .hm-ghint { display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .6rem; border-radius: 999px; background: #a3141a; color: #fff; font-weight: 700; font-size: .78rem; animation: ghint 1.2s ease-in-out infinite; }
  .hm-ghint b { color: #ffe2a0; }
  .hm-ghint.done { display: none; }
  @keyframes ghint { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
}
/* 2.0.58: nút "Dòng thời gian" tách riêng — luôn hiện ở góc trái dưới (điện thoại), không nằm trong cụm liên hệ */
@media (max-width: 599px) {
  /* 2.0.59: luôn hiện, đứng riêng phía trên nút xanh bên phải (không cần mở cụm) */
  .zl-fab .zl-btn.zl-tl, body.fab-on .zl-fab .zl-btn.zl-tl { display: inline-flex; position: static; gap: 0; animation: none; order: -1; margin-bottom: .15rem; }
  .zl-tl > .zl-ic { width: 3.1rem; height: 3.1rem; border-color: #f2c46a; }
  .zl-tl .zl-tx { display: none; }
}
/* 2.0.60: số thứ tự trong Lịch giỗ chạp Trang chủ */
.hm-row-no { flex: none; display: grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 .3rem; border-radius: 999px; box-sizing: border-box;
  background: linear-gradient(180deg, #c8261f, #8f0d12); color: #fff; font: 800 .8rem/1 system-ui, sans-serif; border: 1.5px solid #f2c46a; box-shadow: 0 1px 3px rgba(120,20,10,.25); }
.hm-row.le .hm-row-no { background: linear-gradient(180deg, #f6d36b, #e0a83a); color: #6b1a0b; }
@media (max-width: 599px) { .hm-row { gap: .55rem; } .hm-row-no { min-width: 1.55rem; height: 1.55rem; font-size: .75rem; } }
/* ===== 2.0.61: Đội ngũ chuyên gia (chân trang) ===== */
.ex-sec { width: 100%; max-width: 46rem; margin: 1rem auto 0; padding-top: .9rem; border-top: 1px dashed #e6cf9f; }
.ex-h { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0 0 .8rem; font-family: "Noto Serif", Georgia, serif; font-size: 1.15rem; color: #1f6b3a; }
.ex-h span { position: relative; padding: 0 1rem; }
.ex-h span::before, .ex-h span::after { content: ""; position: absolute; top: 50%; width: 2.2rem; border-top: 1.5px solid #e6b155; }
.ex-h span::before { right: 100%; } .ex-h span::after { left: 100%; }
.ex-edit { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
.ex-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 10rem)); justify-content: center; gap: .8rem; }
.ex-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: .8rem .5rem .7rem; border-radius: 14px; background: #fff; border: 1.5px solid #efd9b1; box-shadow: 0 3px 10px rgba(120,70,10,.08); }
.ex-ava { width: 4.6rem; height: 4.6rem; border-radius: 50%; object-fit: cover; border: 3px solid #e6b155; box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(80,40,10,.2); }
.ex-ini { display: grid; place-items: center; background: linear-gradient(180deg, #2e8b4e, #1f6b3a); color: #fff; font: 700 1.6rem/1 "Noto Serif", Georgia, serif; }
.ex-ten { font-family: "Noto Serif", Georgia, serif; color: #8f0d12; font-size: .98rem; line-height: 1.25; margin-top: .2rem; }
.ex-vt { color: #5a4a30; font-size: .8rem; line-height: 1.3; }
.ex-rows { display: grid; gap: .6rem; margin-bottom: .6rem; }
.ex-frow { display: flex; align-items: center; gap: .5rem; }
.ex-pick { flex: none; width: 3.6rem; height: 3.6rem; border-radius: 50%; overflow: hidden; border: 2px dashed #d9bf8a; background: #fffaf0; cursor: pointer; font-size: .72rem; color: #8a6a3a; padding: 0; }
.ex-pick img { width: 100%; height: 100%; object-fit: cover; }
.ex-fin { flex: 1; min-width: 0; display: grid; gap: .3rem; }
.ex-fin input { width: 100%; }
@media (max-width: 599px) {
  .ex-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 1.2rem) / 3); justify-content: start; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
  .ex-card { scroll-snap-align: start; padding: .6rem .3rem; }
  .ex-ava { width: 3.6rem; height: 3.6rem; }
  .ex-ten { font-size: .85rem; } .ex-vt { font-size: .72rem; }
  .main > .site-foot { padding-bottom: 7rem; }
}
/* ===== 2.0.62: Ký sự / Thư viện ảnh trên điện thoại — đầu trang gọn, thẻ 2 hàng vuốt ngang (mỗi lần 2 thẻ) ===== */
.sw-bar { display: none; }
@media (max-width: 599px) {
  /* đầu trang gọn */
  .pf.ks2 .pf-head, .pf.ks2 .pf-tag { display: none; }
  .pf.ks2 .pf-top { gap: .4rem; margin-bottom: .5rem; }
  .pf.ks2 .pf-right { width: 100%; flex-wrap: nowrap; gap: .4rem; }
  .pf.ks2 .pf-right > :first-child { flex: 1; min-width: 0; }
  .pf.ks2 .pf-add { flex: none; min-height: 2.5rem; padding: .25rem .8rem; font-size: .88rem; }
  .pf.ks2 .pf-filter, .tv-filt { gap: .35rem; padding: .45rem .5rem; margin-bottom: .6rem; border-radius: 12px; }
  .pf.ks2 .pf-frow { display: flex; align-items: center; gap: .4rem; min-width: 0; }
  .pf.ks2 .pf-flbl { flex: none; font-size: .78rem; min-width: 0 !important; padding: 0 !important; background: none !important; color: #24661a !important; border: 0 !important; box-shadow: none !important; }
  .pf.ks2 .pf-fchips, .tv-chips { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; gap: .3rem; overflow-x: auto; scrollbar-width: none; padding: .1rem 0; }
  .pf.ks2 .pf-fchips::-webkit-scrollbar, .tv-chips::-webkit-scrollbar { display: none; }
  .pf.ks2 .pf-fchips > *, .tv-chips > * { flex: none; min-height: 2rem; padding: .15rem .65rem; font-size: .8rem; white-space: nowrap; }
  /* dải thẻ 2 hàng */
  .m2swipe { display: grid !important; grid-template-columns: none !important; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 47%; gap: .55rem !important;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: .1rem .1rem .3rem; }
  .m2swipe::-webkit-scrollbar { display: none; }
  .m2swipe > * { scroll-snap-align: start; min-width: 0; }
  .ks2-box .pf-side { display: none !important; }
  .ks2-box { padding: .5rem; }
  .pf.ks2 .pf-pager { display: none; }
  /* thẻ ký sự nhỏ gọn trong ô 47% */
  .m2swipe .ks-card img, .m2swipe .ks-card .ks-ph, .m2swipe .ks-img { aspect-ratio: 4 / 3; height: auto; }
  .m2swipe h3, .m2swipe .ks-t { font-size: .92rem; line-height: 1.25; }
  .m2swipe p, .m2swipe .ks-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8rem; }
  .tv-grid.m2swipe .tv-it { margin: 0; }
  .tv-grid.m2swipe figcaption { font-size: .8rem; }
  /* thanh gợi ý vuốt */
  .sw-bar { display: flex; align-items: center; gap: .55rem; margin: .45rem .2rem .2rem; font-size: .8rem; color: #5a4a30; }
  .sw-bar[hidden] { display: none; }
  .sw-trk { flex: 1; height: .32rem; border-radius: 99px; background: #e8dcc2; overflow: hidden; display: flex; }
  .sw-trk i { display: block; height: 100%; border-radius: 99px; background: #1f6b3a; transition: margin-left .15s; }
  .sw-lab { flex: none; font-weight: 700; color: #1f6b3a; font-variant-numeric: tabular-nums; }
  .sw-go { flex: none; display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .7rem; min-height: 0; border: 0; border-radius: 99px; background: #1f6b3a; color: #fff; font: inherit; font-weight: 700; font-size: .78rem; cursor: pointer; animation: ghint 1.2s ease-in-out infinite; }
  .sw-go b { color: #ffe2a0; }
  .sw-go.end { opacity: .35; animation: none; }
}
@media (max-width: 599px) {
  .pf.tg-thuvien .tg-head { padding: .5rem .75rem; gap: .6rem; margin-bottom: .55rem; border-radius: 14px; }
  .pf.tg-thuvien .tg-head h1 { font-size: 1.1rem; margin: 0; }
  .pf.tg-thuvien .tg-head p { display: none; }
  .pf.tg-thuvien .tg-hic { width: 2.3rem; height: 2.3rem; }
  .pf.ks2 .ks-tabs { flex: 1; min-width: 0; display: flex; }
  .pf.ks2 .ks-tabs > * { flex: 1; min-width: 0; padding: .3rem .4rem; font-size: .8rem; white-space: nowrap; min-height: 2.3rem; }
}
/* ===== 2.0.63: điện thoại — Lịch sử check-in, Thư viện gọn hơn; nút chia sẻ ở Giới thiệu / Liên hệ ===== */
.tg-share { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.tg-share .tg-edit { margin: 0; }
.tg-sh { display: inline-flex; align-items: center; gap: .35rem; background: #fff; color: #1f6b3a; border: 1.5px solid #9cc77a; }
.tg-sh .hd-i, .tg-sh .hd-i svg { width: 1.05rem; height: 1.05rem; }
.tg-sh:hover { background: #eef7e9; }
@media (max-width: 599px) {
  .pf.ck2-page .pf-head, .pf.ck2-page .pf-desc { display: none; }
  .pf.ck2-page .pf-top, .pf.ks2 .pf-top { gap: .4rem; margin-bottom: .45rem; }
  .pf.ck2-page .pf-right { width: 100%; flex-wrap: nowrap; gap: .4rem; }
  .pf.ck2-page .pf-right > :first-child { flex: 1; min-width: 0; display: flex; }
  .pf.ck2-page .ks-tabs > * { flex: 1; min-width: 0; padding: .3rem .4rem; font-size: .8rem; white-space: nowrap; min-height: 2.3rem; }
  .pf.ck2-page .pf-add { flex: none; min-height: 2.5rem; padding: .25rem .75rem; font-size: .86rem; }
  .pf.ck2-page .pf-filter { display: grid; gap: .3rem; padding: .45rem .5rem; margin-bottom: .45rem; border: 1.5px solid #ecc874; border-radius: 12px; background: rgba(255,250,240,.9); }
  .pf.ck2-page .pf-frow { display: flex; align-items: center; gap: .4rem; min-width: 0; }
  .pf.ck2-page .pf-flbl { flex: none; min-width: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; color: #24661a !important; font-size: .78rem !important; gap: .2rem; }
  .pf.ck2-page .pf-flbl .pf-i { display: none; }
  .pf.ck2-page .pf-fchips { flex: 1; min-width: 0; display: flex; flex-wrap: nowrap; gap: .3rem; overflow-x: auto; scrollbar-width: none; padding: .1rem 0; }
  .pf.ck2-page .pf-fchips::-webkit-scrollbar { display: none; }
  .pf.ck2-page .pf-fchips > * { flex: none; min-height: 2rem; padding: .15rem .65rem; font-size: .8rem; white-space: nowrap; }
  .pf.ck2-page .pf-sum { font-size: .8rem; margin: 0 0 .4rem; }
  .ck-list > .m2swipe .ck2 { font-size: .85rem; }
  /* Thư viện ảnh */
  .pf.tg-thuvien .pf-top { margin-bottom: .4rem; }
  .pf.tg-thuvien .tg-head { padding: .4rem .7rem; }
  .tv-filt { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; margin-bottom: .45rem !important; }
  .tv-chips > * { min-height: 1.9rem !important; padding: .1rem .6rem !important; border-width: 1.5px; }
  .tv-grid.m2swipe { grid-auto-columns: 46%; }
  .tv-grid.m2swipe .tv-pic img { aspect-ratio: 4 / 3; height: auto; }
  .tv-grid.m2swipe figcaption { padding: .35rem .45rem .4rem; }
  .tv-grid.m2swipe figcaption a { font-size: .82rem; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .tv-grid.m2swipe .tv-meta { font-size: .72rem; }
}
@media (max-width: 599px) {
  .m2swipe .ksc2-t { font-size: .95rem !important; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: .2rem 0; }
  .m2swipe .ck2-place { font-size: .78rem; line-height: 1.3; }
  .m2swipe .ksc2-in { padding: .45rem .5rem .55rem; font-size: .8rem; }
  .m2swipe .ksc2-pic { aspect-ratio: 4 / 3; height: auto; }
  .m2swipe .ks-chips { gap: .25rem; }
  .m2swipe .ks-chips > * { font-size: .72rem; padding: .05rem .45rem; }
  .pf.ck2-page .ks-tabs > *, .pf.ks2 .ks-tabs > * { font-size: .76rem; padding: .3rem .3rem; }
}
/* 2.0.64: ô xổ xuống chọn Tỉnh / Địa danh (điện thoại, Lịch sử check-in) */
.pf-dd { flex: 1; min-width: 0; width: 100%; min-height: 2.2rem; padding: .2rem 2rem .2rem .7rem; border-radius: 999px; border: 1.5px solid #9cc77a; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231f6b3a'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") right .5rem center / 1.2rem no-repeat;
  -webkit-appearance: none; appearance: none; color: #1f4a20; font: inherit; font-weight: 700; font-size: .85rem; text-overflow: ellipsis; }
.pf-dd:focus { outline: 2px solid #9cc77a; outline-offset: 1px; }
/* 2.0.65: cảnh báo máy chủ chưa cập nhật đủ file PHP (chỉ quản trị thấy) */
.srv-warn { position: fixed; left: 50%; top: .6rem; transform: translateX(-50%); z-index: 9999; width: min(40rem, 94vw); display: grid; gap: .35rem; padding: .7rem .9rem; border-radius: 12px;
  background: #fff4e5; border: 2px solid #e08a00; color: #5a3200; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .88rem; line-height: 1.45; }
.srv-warn b { color: #b35a00; font-size: .95rem; }
.srv-warn .btn { justify-self: end; }

/* ===== 2.0.67 → 2.0.68: Cây check-in Mai tộc (#/checkin-cay) — giao diện theo mẫu ===== */
.kp-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.kp-foot a.kp-cay { color: #1f6b45; }
.ct-page .pf-body { max-width: none; }
.ct-wrap { background: #FAF7F0; border: 1px solid #e6dcc6; border-radius: 16px; padding: 1rem 1.1rem 1.1rem; color: #2b2b2b; }
.ct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ct-title h1 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; font-size: 1.6rem; color: #1F3A3D; font-weight: 800; letter-spacing: -.01em; }
.ct-badge { font-size: .75rem; font-weight: 600; color: #8A3B12; background: #f6e3d2; border-radius: 999px; padding: .15rem .6rem; letter-spacing: 0; }
.ct-desc { margin: .25rem 0 0; color: #6d6a62; font-size: .9rem; }
.ct-stats { display: flex; gap: 1.6rem; flex: none; }
.ct-stat { text-align: right; }
.ct-stat b { display: block; font-size: 1.6rem; line-height: 1.1; color: #1F3A3D; font-weight: 800; }
.ct-stat span { font-size: .75rem; color: #6d6a62; }
.ct-filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .75rem 0 .8rem; }
.ct-sel { min-height: 2.2rem; border: 1px solid #e0d5bd; border-radius: 999px; padding: 0 .7rem; background: #fff; font: inherit; font-size: .88rem; }
.ct-range { display: flex; flex-wrap: wrap; gap: .3rem; }
.ct-chip, .ct-act, .ct-mini { min-height: 2.2rem; border: 1px solid #e0d5bd; background: #fff; color: #1F3A3D; border-radius: 999px; padding: 0 .8rem; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.ct-chip.on, .ct-act[aria-pressed="true"] { background: #1F3A3D; border-color: #1F3A3D; color: #fff; }
.ct-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: .35rem; }
.ct-chip:hover, .ct-act:hover, .ct-mini:hover { border-color: #1F3A3D; }
.ct-mini { min-height: 2rem; font-size: .8rem; padding: 0 .65rem; }
.ct-main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ct-mapbox { position: relative; border-radius: 6px; overflow: hidden; border: 1.5px solid #8fb3d9; background: #E3EDEF; }
.ct-map, .ct-mapbox .leaflet-container { height: clamp(32rem, calc(100vh - 15rem), 56rem); background: #E3EDEF; }
.ct-pane.ct-hide { visibility: hidden; }
.ct-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.ct-svg .ct-land { fill: #F1E7D3; stroke: #D8C7A6; stroke-width: 1; stroke-linejoin: round; }
.ct-mapbox.detail .ct-svg .ct-land { display: none; }
.ct-svg .ct-isle { fill: #B9A98A; }
.ct-svg .ct-bark { fill: #8B5E3C; opacity: .92; }
.ct-svg .ct-twig { fill: none; stroke: #8B5E3C; stroke-width: 1.4; stroke-linecap: round; opacity: .85; }
.ct-svg .ct-lead { fill: none; stroke: #9a8a70; stroke-width: 1; stroke-dasharray: 3 3; }
.ct-nodes { position: absolute; left: 0; top: 0; }
.ct-sea { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; }
.ct-sea.sea { color: #7d97a3; font: 600 13px/1 system-ui, sans-serif; letter-spacing: .2em; }
.ct-sea.isl { color: #6f8a96; font: italic 11px/1.2 system-ui, 'Segoe UI', Arial, sans-serif; }
.ct-node { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; padding: 0; cursor: pointer; box-shadow: 0 1px 3px rgba(60, 30, 10, .35);
  color: #fff; font: 700 11px/1 system-ui, sans-serif; display: grid; place-items: center; pointer-events: auto; transition: transform .15s; }
.ct-node::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--rc); background: var(--rc); opacity: 0; pointer-events: none; z-index: -1; }
.ct-node:hover, .ct-node:focus-visible, .ct-node.hl { transform: translate(-50%, -50%) scale(1.3); outline: 3px solid #1F3A3D; outline-offset: 2px; }
.ct-r1 { --rc: #C62828; background: #C62828; } .ct-r2 { --rc: #D9480F; background: #D9480F; } .ct-r3 { --rc: #E07A10; background: #E07A10; }
.ct-r4 { --rc: #E9A21A; background: #E9A21A; } .ct-r5 { --rc: #E9B949; background: #E9B949; color: #4a3500 !important; } .ct-r6 { --rc: #E6C878; background: #E6C878; color: #4a3500 !important; }
.ct-old { background: #D2BC8E; }
.ct-node.ct-r1 { border: 3px solid #F2B233; font-size: 14px; box-shadow: 0 0 0 5px rgba(198, 40, 40, .18), 0 2px 6px rgba(0, 0, 0, .3); }
.ct-node.ct-r1::after { animation: ctPulse1 1.5s ease-out infinite; }
.ct-node.ct-r2::after { animation: ctPulse2 1.9s ease-out infinite; } .ct-node.ct-r3::after { animation: ctPulse3 2.3s ease-out infinite; }
.ct-node.ct-r4::after { animation: ctPulse4 2.7s ease-out infinite; } .ct-node.ct-r5::after { animation: ctPulse5 3.1s ease-out infinite; }
.ct-node.ct-r6::after { animation: ctPulse6 3.5s ease-out infinite; }
@keyframes ctPulse1 { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.7); opacity: 0; } }
@keyframes ctPulse2 { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes ctPulse3 { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes ctPulse4 { 0% { transform: scale(1); opacity: .4; } 100% { transform: scale(1.65); opacity: 0; } }
@keyframes ctPulse5 { 0% { transform: scale(1); opacity: .35; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes ctPulse6 { 0% { transform: scale(1); opacity: .3; } 100% { transform: scale(1.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ct-node::after { animation: none !important; } .ct-node { transition: none; } }
.ct-pin { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; background: #1F3A3D; color: #fff; border: 2px solid #fff; z-index: 1500;
  font: 700 12px/1 system-ui, sans-serif; display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.ct-pin.root { border-color: #F2B233; }
.ct-pin.on { background: #8A3B12; }
.ct-pin:focus-visible { outline: 3px solid #F2B233; outline-offset: 2px; }
.ct-lab { position: absolute; z-index: 1400; white-space: nowrap; background: rgba(255, 255, 255, .78); border: 0; border-radius: 4px; padding: 1px 4px; cursor: pointer;
  font: 600 12px/1.3 system-ui, sans-serif; color: #2b2b2b; text-shadow: 0 0 3px #fff; }
.ct-lab.on { color: #8A3B12; }
.ct-tip { position: absolute; z-index: 2500; width: 270px; background: #fff; border: 1px solid #e0d5bd; border-radius: 12px; box-shadow: 0 8px 26px rgba(40, 30, 10, .22); overflow: hidden; pointer-events: none; font-size: .86rem; }
.ct-tip-img { display: block; width: 100%; height: 120px; object-fit: cover; }
.ct-tip-tx { padding: .55rem .7rem .65rem; }
.ct-tip-tx > b { display: block; color: #1F3A3D; font-size: .98rem; margin: .15rem 0 .25rem; }
.ct-tip-tx p { margin: .12rem 0; color: #333; }
.ct-tip-tx p span { color: #6d6a62; }
.ct-tip-hd { color: #6d6a62; font-size: .8rem; }
.ct-tag { font-style: normal; font-weight: 700; font-size: .72rem; border-radius: 999px; padding: .1rem .5rem; background: #efe6d2; color: #6b5420; white-space: nowrap; }
.ct-tag.r1 { background: #f9dccc; color: #8A3B12; } .ct-tag.r2 { background: #fbe1d2; color: #a3360b; } .ct-tag.r3 { background: #fbe8d2; color: #9a520a; }
.ct-tag.r4, .ct-tag.r5, .ct-tag.r6 { background: #f8eccc; color: #7a5a10; }
.ct-sheet { position: absolute; left: .5rem; right: .5rem; bottom: .5rem; z-index: 2600; background: #fff; border-radius: 16px; box-shadow: 0 -4px 22px rgba(0, 0, 0, .25); padding: .6rem .7rem .7rem; max-height: 75%; overflow: auto; }
.ct-sheet-in { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .6rem; font-size: .86rem; margin-bottom: .5rem; }
.ct-sheet-in .ct-tip-img { height: 6.5rem; border-radius: 10px; }
.ct-sheet-in .ct-tip-tx { padding: 0; }
.ct-sheet-x { position: absolute; right: .35rem; top: .25rem; width: 2.2rem; height: 2.2rem; border: 0; background: none; font-size: 1.5rem; cursor: pointer; }
.ct-sheet .btn { width: 100%; }
.ct-empty { position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); z-index: 2400; background: #fff; border-radius: 999px; padding: .4rem 1rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); color: #6b5420; font-weight: 600; }
.ct-legend { position: absolute; left: .7rem; bottom: .7rem; z-index: 1000; background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); padding: .5rem .7rem; font-size: .74rem; color: #444; display: grid; gap: .25rem; }
.ct-legend b { font-size: .78rem; color: #1F3A3D; }
.ct-legend div { display: flex; align-items: center; gap: .3rem; }
.ct-legend i { display: inline-grid; place-items: center; width: 10px; height: 10px; border-radius: 50%; font: 700 9px/1 system-ui, sans-serif; color: #fff; font-style: normal; }
.ct-legend .lg-r1 { width: 15px; height: 15px; background: #C62828; border: 2px solid #F2B233; box-shadow: 0 0 0 3px rgba(198, 40, 40, .2); }
.ct-legend .lg-r2 { background: #D9480F; } .ct-legend .lg-r3 { background: #E07A10; } .ct-legend .lg-r5 { background: #E9B949; } .ct-legend .lg-old { width: 8px; height: 8px; background: #D2BC8E; }
.ct-legend .lg-pin { width: 15px; height: 15px; background: #1F3A3D; }
.ct-side { display: grid; gap: .9rem; min-width: 0; }
.ct-list > li { min-width: 0; }
.ct-card { min-width: 0; background: #fff; border: 1px solid #ece3cf; border-radius: 14px; padding: .9rem 1rem 1rem; }
.ct-card h2 { font-size: 1.02rem; color: #1F3A3D; margin: 0 0 .6rem; font-weight: 700; }
.ct-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.ct-row { width: 100%; display: flex; align-items: center; gap: .65rem; text-align: left; background: #fff; border: 1px solid #ece3cf; border-radius: 10px; padding: .5rem .65rem; font: inherit; cursor: pointer; color: inherit; }
.ct-row:hover, .ct-row:focus-visible { border-color: #c9b48a; background: #fffaf0; }
.ct-row time { flex: none; font-size: .8rem; color: #6d6a62; }
.ct-dotc { flex: none; width: 1.55rem; height: 1.55rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 .75rem/1 system-ui, sans-serif; font-style: normal; }
.ct-dotc.ct-r1 { border: 2px solid #F2B233; box-shadow: 0 0 0 3px rgba(198, 40, 40, .15); }
.ct-dotc.ct-r5, .ct-dotc.ct-r6 { color: #4a3500; }
.ct-dotc.ct-old { width: .9rem; height: .9rem; margin: 0 .32rem; }
.ct-row-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-row-tx b { color: #222; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-row-tx small { color: #6d6a62; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-plist .ct-row time { width: 5.4rem; }
.ct-plist { max-height: 18rem; overflow: auto; padding-right: .2rem; }
.ct-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: .8rem; border-bottom: 1px solid #ece3cf; }
.ct-pchip { min-height: 2.1rem; border: 1px solid #e0d5bd; background: #fff; border-radius: 999px; padding: 0 .8rem; font: inherit; font-size: .82rem; cursor: pointer; color: #1F3A3D; }
.ct-pchip:hover { border-color: #1F3A3D; }
.ct-pchip.on { background: #1F3A3D; border-color: #1F3A3D; color: #fff; font-weight: 700; }
.ct-place { padding-top: .8rem; }
.ct-place-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.ct-place-hd h2 { margin: 0; }
.ct-cnt { flex: none; color: #8A3B12; font-size: .82rem; }
.ct-meta { margin: .1rem 0 .5rem; color: #6d6a62; font-size: .8rem; }
.ct-pacts { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.ct-hint { color: #6d6a62; font-size: .88rem; margin: .8rem 0 0; }
@media (max-width: 1099px) { .ct-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) {
  .ct-wrap { padding: .7rem; border-radius: 12px; }
  .ct-head { flex-direction: column; gap: .5rem; }
  .ct-title h1 { font-size: 1.2rem; } .ct-desc { font-size: .8rem; }
  .ct-stats { width: 100%; justify-content: space-around; gap: .5rem; } .ct-stat { text-align: center; } .ct-stat b { font-size: 1.3rem; }
  .ct-filters { gap: .3rem; } .ct-sel { flex: 1 1 100%; } .ct-acts { margin-left: 0; width: 100%; } .ct-act { flex: 1; justify-content: center; padding: 0 .4rem; font-size: .78rem; }
  .ct-chip { padding: 0 .6rem; font-size: .8rem; }
  .ct-map, .ct-mapbox .leaflet-container { height: 60vh; min-height: 20rem; }
  .ct-legend { font-size: .66rem; padding: .35rem .5rem; gap: .15rem; }
  .ct-card { padding: .7rem; }
}
html.tv .ct-wrap { font-size: 150%; }
html.tv .ct-lab { font-size: 18px; } html.tv .ct-tip { width: 400px; }

/* 2.0.69: Cây check-in xem toàn màn hình */
.ct-fsctl { position: absolute; right: .6rem; top: .6rem; z-index: 1000; width: 2.4rem; height: 2.4rem; border-radius: 8px; border: 1px solid #c9d6dc; background: #fff; color: #1F3A3D;
  font: 700 1.15rem/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, .15); display: grid; place-items: center; }
.ct-fsctl:hover, .ct-fsctl:focus-visible { background: #1F3A3D; color: #fff; }
.ct-wrap.ct-fs { position: fixed; inset: 0; z-index: 48; border-radius: 0; border: 0; padding: .7rem .9rem; overflow: auto; display: flex; flex-direction: column; }
.ct-wrap.ct-fs .ct-filters { margin: .5rem 0 .6rem; }
.ct-wrap.ct-fs .ct-main { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1.6fr) minmax(19rem, 1fr); }
.ct-wrap.ct-fs .ct-map, .ct-wrap.ct-fs .ct-mapbox .leaflet-container { height: calc(100dvh - 9.5rem); }
.ct-wrap.ct-fs .ct-side { max-height: calc(100dvh - 9.5rem); overflow: auto; }
html.ct-fs-on body { overflow: hidden; }
@media (max-width: 1099px) { .ct-wrap.ct-fs .ct-main { grid-template-columns: minmax(0, 1fr); } .ct-wrap.ct-fs .ct-side { max-height: none; } }
@media (max-width: 599px) {
  .ct-acts .ct-fsbtn { display: none; }   /* điện thoại: dùng nút ⛶ trên bản đồ */
  .ct-wrap.ct-fs { padding: .4rem; }
  .ct-wrap.ct-fs .ct-head, .ct-wrap.ct-fs .ct-filters { display: none; }
  .ct-wrap.ct-fs .ct-map, .ct-wrap.ct-fs .ct-mapbox .leaflet-container { height: calc(100dvh - 1rem); }
}
/* 2.0.70: tab Miền Bắc / Trung / Nam · Hôm nay; trình chiếu ảnh check-in */
.ct-mien { padding-right: .35rem; margin-right: .1rem; border-right: 1px solid #e0d5bd; }
.ct-chip.ct-tab { border-color: #c9b48a; background: #fffaf0; color: #8A3B12; font-weight: 700; }
.ct-chip.ct-tab.on { background: #8A3B12; border-color: #8A3B12; color: #fff; }
.ct-show { position: absolute; inset: 0; z-index: 2700; background: #111; opacity: 0; pointer-events: none; transition: opacity .45s ease; overflow: hidden; }
.ct-show.in { opacity: 1; pointer-events: auto; }
.ct-show-bg { position: absolute; inset: -20px; background: center / cover no-repeat; filter: blur(18px) brightness(.55); }
.ct-show-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; animation: ctKen 2.4s ease-out both; }
@keyframes ctKen { from { transform: scale(1.06); } to { transform: scale(1); } }
.ct-show-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1rem .9rem; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .55rem; }
.ct-show-cap b { font-size: 1.1rem; }
.ct-show-cap span { color: #f1e7d3; font-size: .88rem; }
.ct-show-cap small { flex-basis: 100%; color: #e8e2d4; font-size: .84rem; }
.ct-showbar { position: absolute; left: 50%; top: .6rem; transform: translateX(-50%); z-index: 2800; display: flex; align-items: center; gap: .3rem; max-width: calc(100% - 7.5rem);
  background: rgba(31, 58, 61, .92); color: #fff; border-radius: 999px; padding: .25rem .3rem .25rem .8rem; box-shadow: 0 3px 12px rgba(0, 0, 0, .3); font-size: .82rem; }
.ct-showtx { min-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-sb { flex: none; min-width: 2rem; height: 2rem; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font: 700 .85rem/1 system-ui, sans-serif; cursor: pointer; padding: 0 .5rem; }
.ct-sb:hover, .ct-sb:focus-visible { background: #F2B233; color: #1F3A3D; }
.ct-node.spot { transform: translate(-50%, -50%) scale(1.6); z-index: 2600 !important; outline: 3px solid #F2B233; outline-offset: 2px; animation: ctSpot .9s ease-out infinite; }
@keyframes ctSpot { 0% { box-shadow: 0 0 0 0 rgba(242, 178, 51, .9); } 100% { box-shadow: 0 0 0 26px rgba(242, 178, 51, 0); } }
.ct-mini.ct-play { background: #8A3B12; border-color: #8A3B12; color: #fff; }
@media (prefers-reduced-motion: reduce) { .ct-show { transition: none; } .ct-show-img { animation: none; } .ct-node.spot { animation: none; } }
@media (max-width: 599px) { .ct-mien { border-right: 0; padding-right: 0; } .ct-showbar { max-width: calc(100% - 6.5rem); font-size: .74rem; } .ct-show-cap b { font-size: .98rem; } }
/* 2.0.71: sự kiện / check-in "nổi lên" trên bản đồ + thẻ thông tin trong trình chiếu */
.ct-float { position: absolute; z-index: 2300; width: max-content; display: flex; align-items: center; gap: .45rem; max-width: 15.5rem; padding: .3rem .65rem .3rem .3rem; border-radius: 12px;
  background: #fff; border: 2px solid #1F3A3D; box-shadow: 0 6px 18px rgba(40, 30, 10, .28); cursor: pointer; text-align: left; font: inherit; color: #222;
  animation: ctFloat 2.6s ease-in-out infinite; }
.ct-float::after { content: ''; position: absolute; left: 50%; top: 100%; width: 2px; height: var(--tail, 20px); background: repeating-linear-gradient(#1F3A3D 0 4px, transparent 4px 7px); transform: translateX(-50%); }
.ct-float.ct-ev { border-color: #C62828; background: #fff7ef; }
.ct-float.ct-ev::after { background: repeating-linear-gradient(#C62828 0 4px, transparent 4px 7px); }
.ct-float img, .ct-float-ic { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: #f1e7d3; font-style: normal; font-size: 1.3rem; }
.ct-float-tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ct-float-tx em { font-style: normal; font-size: .68rem; font-weight: 800; letter-spacing: .02em; color: #1F3A3D; text-transform: uppercase; }
.ct-float.ct-ev .ct-float-tx em { color: #C62828; }
.ct-float-tx b { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-float-tx small { font-size: .74rem; color: #6d6a62; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-float:hover, .ct-float:focus-visible { outline: 3px solid #F2B233; outline-offset: 2px; z-index: 2400; }
.ct-float.spot { outline: 3px solid #F2B233; outline-offset: 2px; box-shadow: 0 0 0 8px rgba(242, 178, 51, .35), 0 6px 18px rgba(40, 30, 10, .3); }
@keyframes ctFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.ct-show.info { background: rgba(250, 247, 240, .5); display: grid; place-items: center; }
.ct-info { width: min(26rem, calc(100% - 2rem)); background: #fff; border-radius: 16px; border: 1px solid #e0d5bd; box-shadow: 0 12px 32px rgba(40, 30, 10, .25); padding: .9rem 1.1rem 1rem;
  font-size: .9rem; animation: ctInfoIn .35s ease-out both; max-height: calc(100% - 5rem); overflow: auto; }
.ct-info h3 { margin: .3rem 0 .4rem; font-size: 1.15rem; color: #1F3A3D; }
.ct-info p { margin: .2rem 0; color: #333; }
.ct-info p span { color: #6d6a62; }
.ct-info-mo { padding-top: .35rem; border-top: 1px dashed #e0d5bd; margin-top: .45rem !important; white-space: pre-line; }
.ct-info-acts { margin-top: .7rem; display: flex; justify-content: flex-end; }
.ct-tag.ct-evtag { background: #C62828; color: #fff; }
@keyframes ctInfoIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ct-float, .ct-info { animation: none; } }
@media (max-width: 599px) { .ct-float { max-width: 12rem; padding: .25rem .5rem .25rem .25rem; } .ct-float img, .ct-float-ic { width: 2.1rem; height: 2.1rem; } .ct-float-tx b { font-size: .78rem; } }
/* 2.0.72: thẻ thông tin trình chiếu hiện thẳng chi tiết bản tin */
.ct-show.info .ct-info { width: min(38rem, calc(100% - 2rem)); max-height: calc(100% - 4.8rem); margin-top: 2.6rem; overscroll-behavior: contain; }
.ct-info-meta { color: #6d6a62 !important; font-size: .84rem; }
.ct-info-lead { font-weight: 600; color: #1F3A3D !important; }
.ct-info-body { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed #e0d5bd; font-size: .92rem; line-height: 1.6; }
.ct-info-body p { margin: 0 0 .55rem; }
@media (max-width: 599px) { .ct-show.info .ct-info { width: calc(100% - 1rem); margin-top: 3rem; padding: .7rem .8rem; } }
/* 2.0.73: ẩn / hiện bảng bên phải của Cây check-in */
.ct-sidectl { position: absolute; right: .6rem; top: 3.5rem; z-index: 1000; height: 2.1rem; border-radius: 8px; border: 1px solid #c9d6dc; background: #fff; color: #1F3A3D;
  font: 700 .78rem/1 system-ui, sans-serif; padding: 0 .6rem; cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, .15); white-space: nowrap; }
.ct-sidectl:hover, .ct-sidectl:focus-visible, .ct-sidectl[aria-pressed="true"] { background: #1F3A3D; color: #fff; }
.ct-main.side-off, .ct-wrap.ct-fs .ct-main.side-off { grid-template-columns: minmax(0, 1fr); }
/* 2.0.76: báo check-in / lễ hôm nay ở nơi đang bị lọc ẩn */
.ct-away { position: absolute; right: .7rem; bottom: .7rem; z-index: 1100; max-width: min(22rem, calc(100% - 18.5rem)); text-align: left; border: 0; border-radius: 999px; padding: .5rem 1rem;
  background: #C62828; color: #fff; font: 700 .84rem/1.25 system-ui, sans-serif; cursor: pointer; box-shadow: 0 4px 14px rgba(198, 40, 40, .35); animation: ctFloat 2.6s ease-in-out infinite; }
.ct-away:hover, .ct-away:focus-visible { background: #8A3B12; outline: 3px solid #F2B233; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ct-away { animation: none; } }
@media (max-width: 599px) { .ct-away { bottom: auto; top: .6rem; right: auto; left: 3.4rem; font-size: .74rem; max-width: calc(100% - 7rem); } }
.ct-showbar:not([hidden]) ~ .ct-away { display: none; }
/* 2.0.77: thẻ "Hôm nay / ngày gần nhất" ở đầu bảng phải */
.ct-focus { border: 2px solid #C62828; background: #fffaf3; }
.ct-focus h2 { color: #C62828; }
.ct-row.ev { border-color: #f1c7b8; background: #fff7ef; }
.ct-dotc.ct-evdot { background: #fff; border: 1.5px solid #C62828; font-size: .8rem; }
/* 2.0.78: nút "Chia sẻ link" gia phả công khai */
.btn.sm.tb-share { background: #1f6b45 !important; border-color: #1f6b45 !important; color: #fff !important; }
.btn.sm.tb-share:hover { background: #17573a; }
.share-pub { margin: .2rem 0 .7rem; padding: .55rem .75rem; border-radius: 10px; font-size: .9rem; }
.share-pub.ok { background: #e8f5ec; border: 1px solid #a9d3b6; color: #1f5a3a; }
.share-pub.no { background: #fff4e0; border: 1px solid #f0c27a; color: #7a4a00; }
/* 2.0.79: nhấn mạnh "Cây check-in" — chấm đỏ nhấp nháy + biểu tượng cây rung nhẹ, toả sáng */
.hd-sb.hs-ckcay, .nav-sub-item.ck-cay-nav { position: relative; }
.ck-blink { position: absolute; top: 1px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: #e53935; border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(229, 57, 53, .75); animation: ckBlink 1.3s ease-out infinite; pointer-events: none; }
.nav-sub-item.ck-cay-nav .ck-blink { top: 50%; right: 2.2rem; margin-top: -6px; }
@keyframes ckBlink { 0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, .75); opacity: 1; } 50% { opacity: .55; } 70% { box-shadow: 0 0 0 9px rgba(229, 57, 53, 0); opacity: 1; } 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); } }
.hd-sb.hs-ckcay .hd-i, .nav-sub-item.ck-cay-nav .em { animation: ckTree 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes ckTree { 0%, 70%, 100% { transform: rotate(0) scale(1); filter: none; } 78% { transform: rotate(-9deg) scale(1.15); filter: drop-shadow(0 0 4px #F2B233); } 86% { transform: rotate(8deg) scale(1.15); filter: drop-shadow(0 0 6px #F2B233); } 93% { transform: rotate(-3deg) scale(1.05); } }
.hd-sb.hs-ckcay:not(.on) { border-color: #e9a21a; box-shadow: 0 0 0 0 rgba(242, 178, 51, .6); animation: ckGlow 2.4s ease-in-out infinite; }
@keyframes ckGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 178, 51, 0); } 50% { box-shadow: 0 0 10px 2px rgba(242, 178, 51, .55); } }
@media (prefers-reduced-motion: reduce) { .ck-blink, .hd-sb.hs-ckcay .hd-i, .nav-sub-item.ck-cay-nav .em, .hd-sb.hs-ckcay { animation: none !important; } }
/* 2.0.80: bảng số liệu nhánh gia phả (Thông tin dòng họ) */
.fam-dash { margin: .2rem 0 .8rem; background: linear-gradient(180deg, #fffaf0, #fff); border: 1px solid #ecd9b4; border-radius: 16px; padding: .8rem .9rem; display: grid; gap: .7rem; }
.fd-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.fd-card { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid #f0e2c4; border-radius: 14px; padding: .6rem .7rem; min-width: 0; box-shadow: 0 1px 3px rgba(120, 70, 10, .06); }
.fd-ic { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: #fdf0d8; }
.fd-card.c-doi .fd-ic { background: #e8f3e6; } .fd-card.c-tv .fd-ic { background: #fde7e3; } .fd-card.c-cc .fd-ic { background: #e6f0fb; }
.fd-card.c-dr .fd-ic { background: #f6e8f8; } .fd-card.c-ns .fd-ic { background: #fff3c9; }
.fd-tx { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fd-tx b { font-size: 1.35rem; color: #8e0d12; font-family: Georgia, 'Times New Roman', serif; }
.fd-tx span { font-size: .84rem; font-weight: 700; color: #4a3a22; }
.fd-tx small { font-size: .74rem; color: #7b6a4f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-lbl { font-size: .82rem; font-weight: 700; color: #6b4a14; margin-right: .2rem; white-space: nowrap; }
.fd-famous { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.fd-chip { display: inline-flex; flex-direction: column; align-items: flex-start; border: 1.5px solid #e9b949; background: #fffbea; border-radius: 12px; padding: .25rem .65rem; cursor: pointer; font: inherit; text-align: left; line-height: 1.2; }
.fd-chip b { font-size: .86rem; color: #7a4a00; } .fd-chip small { font-size: .7rem; color: #8a6a2a; }
.fd-chip:hover, .fd-chip:focus-visible { background: #F2B233; border-color: #c8901a; }
.fd-more { font-size: .8rem; color: #7b6a4f; }
.fd-gens { display: flex; align-items: flex-end; gap: .6rem; }
.fd-bars { flex: 1; display: flex; align-items: flex-end; gap: 4px; height: 4.2rem; overflow-x: auto; padding-top: .9rem; }
.fd-bar { flex: 1 0 1.6rem; max-width: 3rem; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.fd-bar i { width: 70%; min-height: 6px; background: linear-gradient(180deg, #d9480f, #8e0d12); border-radius: 4px 4px 0 0; position: relative; }
.fd-bar i em { position: absolute; top: -1rem; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .66rem; color: #6b4a14; white-space: nowrap; }
.fd-bar span { font-size: .66rem; color: #7b6a4f; margin-top: 2px; }
@media (max-width: 1100px) { .fd-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) {
  .fam-dash { padding: .55rem; border-radius: 12px; gap: .5rem; }
  .fd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .fd-card { padding: .45rem .5rem; gap: .45rem; } .fd-ic { width: 2.1rem; height: 2.1rem; font-size: 1.1rem; } .fd-tx b { font-size: 1.1rem; }
  .fd-card.c-ns { grid-column: 1 / -1; }
  .fd-gens { flex-direction: column; align-items: stretch; gap: .2rem; }
  .fd-gens .fd-bars { flex: none; height: 4.4rem; }
}
/* 2.0.81: ẩn / hiện bảng số liệu nhánh */
.fd-head { display: flex; align-items: center; gap: .6rem; margin-bottom: -.2rem; }
.fd-ttl { font-weight: 800; color: #8e0d12; font-size: .92rem; white-space: nowrap; }
.fd-sum { flex: 1; min-width: 0; font-size: .84rem; color: #6b4a14; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-tog { margin-left: auto; flex: none; border: 1px solid #e0c58e; background: #fff; color: #8e0d12; border-radius: 999px; padding: .25rem .8rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.fd-tog:hover, .fd-tog:focus-visible { background: #8e0d12; color: #fff; border-color: #8e0d12; }
.fam-dash.off { padding: .45rem .8rem; }
.fam-dash.off .fd-head { margin: 0; }
@media (max-width: 599px) { .fam-dash.off .fd-sum { display: none; } }
/* 2.0.82: dãy ảnh check-in / ký sự / địa danh — nút tự chạy, toàn màn hình, tiêu đề bên dưới */
.sl-tools { position: absolute; top: .55rem; right: .55rem; z-index: 4; display: flex; gap: .35rem; }
.sl-tool { width: 2.4rem; height: 2.4rem; border-radius: 10px; border: 0; background: rgba(20, 12, 4, .55); color: #fff; font: 700 1.05rem/1 system-ui, sans-serif; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); }
.sl-tool:hover, .sl-tool:focus-visible { background: #F2B233; color: #3a2400; outline: none; }
.sl-tool[aria-pressed="true"] { background: #c8261f; }
.sl-cap { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem .55rem; background: linear-gradient(180deg, #3a2412, #2B1A0E); color: #fff4dc; font-size: .9rem; line-height: 1.3; }
.sl-cap-t { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-cap-n { flex: none; font-size: .78rem; color: #f2d38a; }
.slider.sl-photo .sl-dots { bottom: 3rem; }
.slider.sl-photo:has(.sl-cap) .sl-dots { bottom: calc(2.6rem + .4rem); }
.slider.sl-fs { position: fixed; inset: 0; z-index: 9999; margin: 0; border-radius: 0; background: #000; display: flex; flex-direction: column; }
.slider.sl-fs .sl-track { flex: 1; min-height: 0; }
.slider.sl-fs .sl-item { height: 100%; display: grid; place-items: center; }
.slider.sl-fs .sl-item > img { width: 100%; height: calc(100dvh - 3.2rem) !important; max-height: none !important; aspect-ratio: auto !important; object-fit: contain; cursor: default; background: #000; }
.slider.sl-fs .sl-track { align-items: stretch; }
.slider.sl-fs .sl-cap { flex: none; min-height: 3.2rem; }
.slider.sl-fs .sl-dots { bottom: 3.8rem; }
.slider.sl-fs .sl-cap { font-size: 1.05rem; padding: .7rem 1.2rem; }
.slider.sl-fs .sl-tool { width: 2.9rem; height: 2.9rem; font-size: 1.25rem; }
html.sl-fs-on body { overflow: hidden; }
@media (max-width: 599px) { .sl-tool { width: 2.1rem; height: 2.1rem; font-size: .95rem; } .sl-cap { font-size: .82rem; padding: .4rem .6rem; } }
/* 2.0.83: tiêu đề trên ảnh trình chiếu (Cây check-in) và dưới ảnh lớn */
.ct-show-cap { z-index: 2; }
.ct-wrap.ct-fs .ct-show-cap { padding: 3rem 1.6rem 1.4rem; }
.ct-wrap.ct-fs .ct-show-cap b { font-size: 1.5rem; } .ct-wrap.ct-fs .ct-show-cap span { font-size: 1rem; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.2rem 1.2rem 1rem; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); color: #fff; font-weight: 700; font-size: 1.05rem; text-align: center; pointer-events: none; text-shadow: 0 1px 3px #000; }
.lightbox:has(.lb-cap) .lb-count { bottom: 3.4rem; }
/* 2.0.83: toàn màn hình Cây check-in — bản đồ lấp đúng phần còn lại của màn hình (bộ lọc xuống 2 dòng vẫn không bị tràn) */
@media (min-width: 600px) {
  .ct-wrap.ct-fs { overflow: hidden; }
  .ct-wrap.ct-fs .ct-main { flex: 1; min-height: 0; align-items: stretch; }
  .ct-wrap.ct-fs .ct-mapbox { height: 100%; min-height: 18rem; }
  .ct-wrap.ct-fs .ct-map, .ct-wrap.ct-fs .ct-mapbox .leaflet-container { height: 100% !important; }
  .ct-wrap.ct-fs .ct-side { max-height: 100%; height: 100%; overflow: auto; }
}

/* ===== 2.0.84: Trang giới thiệu phần mềm (landing) — khách chưa đăng nhập ===== */
html.lp-on .topbar, html.lp-on .zl-fab, html.lp-on .srv-warn, html.lp-on #top-ticker, html.lp-on .site-foot { display: none !important; }
html.lp-on .shell { --top-h: 0px; display: block; height: auto; overflow: visible; }
html.lp-on .main { overflow: visible; }
html.lp-on main, html.lp-on #main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
html.lp-on body { background: #FAF6EE; }
.lp { --lp-red: #8B2A22; --lp-red2: #6f1f19; --lp-ink: #2a2118; --lp-mute: #6b5f50; --lp-line: #ece1cc; --lp-card: #fffdf8; --lp-green: #2f7d2a;
  color: var(--lp-ink); background: #FAF6EE radial-gradient(#e7dccb 1px, transparent 1.2px) 0 0 / 22px 22px; font-size: 16px; line-height: 1.55; min-height: 100vh; }
.lp h1, .lp h2, .lp h3 { font-family: 'Noto Serif', Georgia, 'Times New Roman', serif; }
.lp-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem; padding: .55rem clamp(.8rem, 3vw, 2.5rem); background: rgba(250, 246, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--lp-line); }
.lp-brand { display: flex; align-items: center; gap: .55rem; border: 0; background: none; cursor: pointer; padding: 0; text-align: left; color: inherit; }
.lp-brand img { width: 2.6rem; height: 2.6rem; border-radius: 50%; }
.lp-brand b { display: block; font: 800 1.15rem/1.1 'Noto Serif', Georgia, serif; color: var(--lp-red); }
.lp-brand small { font-size: .74rem; color: var(--lp-mute); font-style: italic; }
.lp-links { display: flex; gap: .2rem; margin-left: auto; }
.lp-links button { border: 0; background: none; font: inherit; font-size: .92rem; font-weight: 600; color: var(--lp-ink); padding: .45rem .6rem; border-radius: 8px; cursor: pointer; }
.lp-links button:hover, .lp-links button:focus-visible { background: #f3e8d4; color: var(--lp-red); }
.lp-top-acts { display: flex; gap: .4rem; align-items: center; }
.lp-burger { display: none; border: 1px solid var(--lp-line); background: #fff; border-radius: 8px; width: 2.4rem; height: 2.4rem; font-size: 1.2rem; cursor: pointer; }
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.9rem; padding: 0 1.3rem; border-radius: 10px; border: 1.5px solid var(--lp-red);
  background: var(--lp-red); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.lp-btn:hover, .lp-btn:focus-visible { background: var(--lp-red2); border-color: var(--lp-red2); color: #fff; }
.lp-btn.ghost { background: #fff; color: var(--lp-ink); border-color: #3a2f25; }
.lp-btn.ghost:hover { background: #f6eee0; color: var(--lp-ink); }
.lp-btn.soft { background: #f1e9db; border-color: #f1e9db; color: var(--lp-ink); }
.lp-btn.soft:hover { background: #e7dcc8; border-color: #e7dcc8; color: var(--lp-ink); }
.lp-btn.sm { min-height: 2.35rem; padding: 0 .9rem; font-size: .88rem; border-radius: 8px; }
.lp-eyebrow { margin: 0 0 .3rem; color: var(--lp-red); font-weight: 800; font-size: .82rem; letter-spacing: .12em; }
.lp-h2 { margin: 0 0 .4rem; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.2; }
.lp-sub { margin: 0 0 1.4rem; color: var(--lp-mute); max-width: 46rem; }
.lp-note { margin: .6rem 0 0; color: var(--lp-mute); font-size: .8rem; font-style: italic; }
.lp-sec { max-width: 1240px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2rem) 0; scroll-margin-top: 4.5rem; }
/* hero */
.lp-hero { max-width: 1240px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem) 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.lp-hero h1 { margin: .2rem 0 1rem; font-size: clamp(2.1rem, 4.1vw, 3.4rem); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.lp-hero h1 em { font-style: normal; color: var(--lp-red); }
.lp-lead { font-size: 1.12rem; color: #4a4036; margin: 0 0 1.5rem; max-width: 36rem; }
.lp-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.1rem; }
.lp-ticks, .lp-ql { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.3rem; color: var(--lp-mute); font-size: .92rem; }
.lp-ticks li::before, .lp-ql li::before { content: '✓'; color: var(--lp-green); font-weight: 800; margin-right: .45rem; }
.lp-clip { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 18px; box-shadow: 0 18px 40px rgba(90, 60, 20, .12); overflow: hidden; }
.lp-clip-stage { position: relative; height: clamp(19rem, 30vw, 23rem); }
.lp-scene { position: absolute; inset: 0; padding: 1.3rem 1.4rem; opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .55s ease, transform .55s ease; }
.lp-scene.in { opacity: 1; transform: none; }
.lp-clip-ft { display: flex; align-items: center; gap: .8rem; padding: .55rem 1rem; border-top: 1px solid var(--lp-line); background: #fbf6ec; }
.lp-clip-lbl { flex: 1; font-weight: 700; font-size: .9rem; color: var(--lp-red); }
.lp-clip-bar { display: flex; gap: .3rem; }
.lp-clip-bar button { width: 1.9rem; height: .9rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.lp-clip-bar i { display: block; width: 100%; height: 4px; border-radius: 4px; background: #e5d8c0; overflow: hidden; position: relative; }
.lp-clip-bar .on i::after { content: ''; position: absolute; inset: 0; background: var(--lp-red); transform-origin: left; animation: lpProg 5s linear forwards; }
@keyframes lpProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.lp-s { height: 100%; display: flex; flex-direction: column; }
.lp-s-hd { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .8rem; }
.lp-s-hd b { display: block; font: 700 1.2rem 'Noto Serif', Georgia, serif; }
.lp-s-hd small { color: var(--lp-mute); }
.lp-chip { display: inline-block; font-size: .78rem; font-weight: 700; background: #eef1ea; color: #3e5a3a; padding: .15rem .6rem; border-radius: 999px; }
.lp-chip.red { background: #fbe4df; color: var(--lp-red); }
.lp-s-row { display: flex; align-items: center; justify-content: center; gap: .4rem; }
.lp-s-row.two { gap: 1.2rem; margin-top: .55rem; }
.lp-pc { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--lp-line); border-radius: 10px; padding: .4rem .7rem .4rem .45rem; min-width: 11rem; animation: lpPop .5s both; }
.lp-s-row.two .lp-pc:nth-child(2) { animation-delay: .15s; }
.lp-pc.vo { background: #faf3e8; border-style: dashed; }
.lp-pc.me { border: 2px solid var(--lp-red); }
.lp-pc b { display: block; font-size: .92rem; } .lp-pc small { color: var(--lp-mute); font-size: .78rem; }
.lp-ava { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; overflow: hidden; display: block; border: 2px solid #d9cdb6; }
.lp-ava svg { width: 100%; height: 100%; display: block; }
.lp-ava.big { width: 4.2rem; height: 4.2rem; }
.lp-wed { width: 1.8rem; height: 2px; background: var(--lp-red); position: relative; display: block; }
.lp-wed::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--lp-red); transform: translate(-50%, -50%); }
.lp-s-fork { height: 1.1rem; margin: 0 auto; width: 55%; border: 2px solid #c9bda6; border-bottom: 0; border-radius: 6px 6px 0 0; margin-top: .55rem; }
@keyframes lpPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lp-s-gio { flex-direction: row; align-items: center; gap: 1.3rem; }
.lp-s-gio-cal { flex: none; width: 8.5rem; text-align: center; background: linear-gradient(180deg, #a3271c, #7a1912); color: #fff; border-radius: 14px; padding: .8rem .5rem; box-shadow: 0 8px 20px rgba(122, 25, 18, .3); animation: lpPop .5s both; }
.lp-s-gio-cal small { letter-spacing: .15em; font-size: .7rem; opacity: .85; }
.lp-s-gio-cal b { display: block; font: 800 3.4rem/1 'Noto Serif', Georgia, serif; margin: .2rem 0; }
.lp-s-gio-cal em { display: block; font-size: .74rem; margin-top: .3rem; opacity: .85; }
.lp-s-gio-tx { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; }
.lp-s-gio-tx > b { font: 700 1.25rem 'Noto Serif', Georgia, serif; }
.lp-cd { display: flex; gap: .4rem; }
.lp-cd span { background: #fff; border: 1px solid var(--lp-line); border-radius: 10px; padding: .3rem .6rem; text-align: center; }
.lp-cd b { display: block; font-size: 1.4rem; color: var(--lp-red); } .lp-cd small { font-size: .7rem; color: var(--lp-mute); }
.lp-s-btn { display: inline-block; background: #f1e9db; color: var(--lp-ink); font-weight: 700; font-size: .85rem; padding: .4rem .8rem; border-radius: 8px; }
.lp-s-map { flex-direction: row; align-items: center; gap: 1rem; }
.lp-s-vn { height: 100%; max-height: 19rem; flex: none; width: auto; background: #E3EDEF; border-radius: 12px; }
.lp-pulse { animation: lpPulse 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes lpPulse { 0% { stroke-width: 1; stroke: #fff; } 60% { stroke-width: 7; stroke: rgba(198, 40, 40, .25); } 100% { stroke-width: 1; stroke: #fff; } }
.lp-s-map-tx { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.lp-s-map-tx b { font: 700 1.25rem 'Noto Serif', Georgia, serif; } .lp-s-map-tx small { color: var(--lp-mute); }
.lp-s-pado { align-items: center; text-align: center; gap: .35rem; background: radial-gradient(circle at 50% 0, #fff8e8, #f6ead2); border-radius: 12px; padding-top: .8rem; }
.lp-pado-t { font: 800 1.5rem 'Noto Serif', Georgia, serif; color: #8a2a12; letter-spacing: .04em; }
.lp-s-pado > small { color: #9b3b1c; font-style: italic; }
.lp-pado-r { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; animation: lpPop .5s both; }
.lp-pado-r:nth-child(4) { animation-delay: .15s; } .lp-pado-r:nth-child(5) { animation-delay: .3s; } .lp-pado-r:nth-child(6) { animation-delay: .45s; }
.lp-pb { min-width: 4.2rem; padding: .2rem .4rem; border-radius: 5px; background: #fff; border: 1px solid #d8c4a0; font-size: .74rem; font-weight: 700; }
.lp-pb.red { background: #a3271c; color: #fff; border-color: #a3271c; } .lp-pb.grn { background: #e7f2df; border-color: #a9cf96; color: #2f5c25; }
.lp-pado-r.small .lp-pb { min-width: 1.6rem; height: .9rem; }
.lp-s-voice { align-items: center; justify-content: center; gap: .9rem; text-align: center; }
.lp-mic { position: relative; width: 5rem; height: 5rem; display: grid; place-items: center; }
.lp-mic span { position: relative; z-index: 2; width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #f4c045, #d99a1c); font-size: 1.7rem; }
.lp-mic i { position: absolute; inset: .5rem; border-radius: 50%; border: 2px solid #e8b23b; animation: lpRing 1.8s ease-out infinite; }
.lp-mic i:nth-of-type(2) { animation-delay: .6s; } .lp-mic i:nth-of-type(3) { animation-delay: 1.2s; }
@keyframes lpRing { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.lp-q { font: italic 700 1.3rem 'Noto Serif', Georgia, serif; color: var(--lp-red); animation: lpPop .5s .4s both; }
.lp-res { display: flex; flex-direction: column; align-items: center; gap: .6rem; animation: lpPop .5s .9s both; }
/* tính năng */
.lp-band { display: flex; align-items: center; gap: .9rem; background: linear-gradient(90deg, #255f23, #3f8f2c); color: #fff; border-radius: 16px; padding: .9rem 1.2rem; margin-bottom: 1rem; box-shadow: 0 6px 16px rgba(37, 95, 35, .25); }
.lp-band-ic { width: 3rem; height: 3rem; border-radius: 50%; background: #f8e6a8; color: #255f23; display: grid; place-items: center; padding: .6rem; }
.lp-band-ic svg { width: 100%; height: 100%; }
.lp-band h2 { margin: 0; font-size: 1.5rem; } .lp-band p { margin: 0; opacity: .9; font-size: .92rem; }
.lp-feats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
.lp-feat { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; text-align: left; background: #fff; border: 1px solid #f0dfbd; border-radius: 16px; padding: 1rem; font: inherit; color: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.lp-feat:hover, .lp-feat:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(120, 70, 10, .12); outline: none; border-color: #e4c27b; }
.lp-fic { width: 2.8rem; height: 2.8rem; border-radius: 12px; background: #fdecd0; display: grid; place-items: center; color: #c8261f; }
.lp-fic .hd-i { width: 1.4rem; height: 1.4rem; display: grid; place-items: center; } .lp-fic svg, .lp-fic img { width: 1.4rem; height: 1.4rem; }
.lp-feat b { color: #8e0d12; font-size: 1.02rem; }
.lp-feat p { margin: 0; color: #4a4036; font-size: .9rem; flex: 1; }
.lp-go { color: #b3261e; font-weight: 800; font-size: .86rem; }
/* demo */
.lp-demo { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1rem; }
.lp-dbox { position: relative; background: #fffdf8 radial-gradient(#ebe1cf 1px, transparent 1.2px) 0 0 / 18px 18px; border: 1px solid var(--lp-line); border-radius: 16px; min-height: 26rem; overflow: auto; }
.lp-dtools { position: absolute; top: .7rem; right: .7rem; z-index: 2; display: flex; background: #fff; border: 1px solid var(--lp-line); border-radius: 10px; overflow: hidden; }
.lp-dtools button { width: 2.4rem; height: 2.3rem; border: 0; background: none; font-size: 1.1rem; cursor: pointer; } .lp-dtools button + button { border-left: 1px solid var(--lp-line); }
.lp-dtools button:hover { background: #f6eee0; }
.lp-dcanvas { padding: 3.2rem 1rem 1.5rem; }
.lp-dtree { transform-origin: top center; transition: transform .2s; display: flex; flex-direction: column; align-items: center; }
.lp-drow { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; }
.lp-dpair { display: flex; align-items: center; gap: .3rem; }
.lp-dline { width: 2px; height: 1.6rem; background: #b9ad95; }
.lp-dline.l { transform: translateX(-6rem); }
.lp-dcard { width: 8.6rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; background: #fff; border: 1px solid var(--lp-line); border-top: 4px solid #3d6b50; border-radius: 12px; padding: .7rem .4rem .6rem; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .15s, transform .15s; }
.lp-dcard.nu { border-top-color: #c46a5f; } .lp-dcard.dau { background: #fbf5eb; }
.lp-dcard .lp-ava { width: 3.2rem; height: 3.2rem; }
.lp-dcard small { font-size: .66rem; letter-spacing: .1em; color: var(--lp-mute); } .lp-dcard b { font-size: .88rem; text-align: center; } .lp-dcard > span:last-child { font-size: .8rem; color: var(--lp-mute); }
.lp-dcard:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .08); }
.lp-dcard.on { border-color: #c9901a; border-top-color: #c9901a; box-shadow: 0 0 0 3px rgba(201, 144, 26, .25); }
.lp-prof { background: #fff; border: 1px solid var(--lp-line); border-radius: 16px; padding: 1.1rem; display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.lp-prof-hd { display: flex; align-items: center; gap: .8rem; margin: .3rem 0 .5rem; }
.lp-prof-hd b { display: block; font-size: 1.15rem; } .lp-prof-hd small { color: var(--lp-mute); }
.lp-prof p { margin: 0; }
.lp-plink { border: 0; background: none; padding: 0; font: inherit; color: var(--lp-ink); text-decoration: underline; cursor: pointer; }
.lp-plink:hover { color: var(--lp-red); }
.lp-hint { color: var(--lp-mute); font-size: .85rem; margin: .6rem 0 !important; }
/* 4 bước */
.lp-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.lp-step { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 16px; padding: 1.3rem; }
.lp-num { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--lp-red); color: #fff; font: 800 1.1rem 'Noto Serif', Georgia, serif; margin-bottom: 1rem; }
.lp-step h3 { margin: 0 0 .4rem; font-size: 1.12rem; } .lp-step p { margin: 0; color: var(--lp-mute); }
/* chế độ xem */
.lp-devs { display: grid; grid-template-columns: 1.4fr .7fr 1.2fr 1fr; gap: 1.3rem; align-items: end; }
.lp-dev { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.lp-dev figcaption b { display: block; font: 700 1.1rem 'Noto Serif', Georgia, serif; } .lp-dev figcaption span { color: var(--lp-mute); font-size: .9rem; }
.lp-devart { display: flex; flex-direction: column; align-items: center; width: 100%; }
.lp-devart .frame { background: #1d1a17; border-radius: 12px; padding: 7px; width: 100%; box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.lp-devart.tv .frame { aspect-ratio: 16 / 9.4; border-radius: 8px; }
.lp-devart.tv .stand { width: 30%; height: 14px; background: #3a342e; border-radius: 0 0 6px 6px; display: block; }
.lp-devart.dt .frame { aspect-ratio: 9 / 18; max-width: 7.5rem; border-radius: 18px; padding: 8px 5px; }
.lp-devart.mt .frame { aspect-ratio: 16 / 10; border-radius: 10px 10px 0 0; }
.lp-devart.mt .base { width: 118%; height: 10px; background: #bdb3a6; border-radius: 0 0 10px 10px; display: block; }
.lp-devart.mtb .frame { aspect-ratio: 4 / 3; border-radius: 16px; padding: 10px; }
.lp-scr { width: 100%; height: 100%; background: #fbf6ec; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.lp-scr .bar { height: 14%; background: linear-gradient(90deg, #a3271c, #7a1912); display: block; }
.lp-scr .mini { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6%; padding: 8%; align-content: center; }
.lp-devart.dt .lp-scr .mini { grid-template-columns: 1fr; }
.lp-scr .b { display: block; height: 0; padding-bottom: 38%; border-radius: 3px; background: #fff; border: 1px solid #d8c4a0; }
.lp-scr .b.r { background: #a3271c; border-color: #a3271c; } .lp-scr .b.g { background: #dceccf; border-color: #a9cf96; }
/* bảng giá */
.lp-price-hd { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.lp-price-hd .lp-sub { margin: 0; }
.lp-tog { display: flex; background: #fff; border: 1px solid var(--lp-line); border-radius: 12px; padding: 4px; }
.lp-tog button { border: 0; background: none; font: inherit; font-weight: 700; padding: .55rem 1rem; border-radius: 9px; cursor: pointer; color: var(--lp-ink); }
.lp-tog button.on { background: var(--lp-red); color: #fff; }
.lp-save { background: #3c8a3a; color: #fff; border-radius: 999px; padding: .05rem .45rem; font-size: .75rem; margin-left: .2rem; }
.lp-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.lp-plan { position: relative; display: flex; flex-direction: column; background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 16px; padding: 1.4rem 1.3rem 1.3rem; }
.lp-plan.hot { border: 2px solid var(--lp-red); box-shadow: 0 14px 30px rgba(139, 42, 34, .14); }
.lp-hot { position: absolute; top: -.85rem; left: 1.2rem; background: var(--lp-red); color: #fff; font-size: .8rem; font-weight: 700; padding: .2rem .7rem; border-radius: 8px; }
.lp-plan h3 { margin: 0; font-size: 1.35rem; } .lp-pmo { margin: .1rem 0 1rem; color: var(--lp-mute); font-size: .9rem; min-height: 2.6em; }
.lp-price b { font: 800 2rem 'Noto Serif', Georgia, serif; } .lp-price span { color: var(--lp-mute); }
.lp-psave { color: var(--lp-green); font-size: .88rem; margin: .2rem 0 1rem; min-height: 2.6em; }
.lp-ql { flex-direction: column; flex-wrap: nowrap; gap: .5rem; color: var(--lp-ink); margin-bottom: 1.3rem; flex: 1; }
.lp-plan .lp-btn { width: 100%; }
/* tư vấn */
.lp-tv { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.lp-form { background: #fff; border: 1px solid var(--lp-line); border-radius: 16px; padding: 1.3rem; display: grid; gap: .8rem; }
.lp-fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.lp-f { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; font-weight: 700; color: #4a4036; }
.lp-f input, .lp-f select, .lp-f textarea { font: inherit; font-weight: 400; min-height: 2.8rem; border: 1.5px solid #ddd0b8; border-radius: 10px; padding: .5rem .7rem; background: #fffdf9; color: var(--lp-ink); }
.lp-f input:focus, .lp-f select:focus, .lp-f textarea:focus { outline: none; border-color: var(--lp-red); box-shadow: 0 0 0 3px rgba(139, 42, 34, .15); }
.lp-trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.lp-fmsg { margin: 0; padding: .6rem .8rem; border-radius: 10px; font-weight: 600; }
.lp-fmsg.ok { background: #e7f4e3; color: #2a6a28; } .lp-fmsg.err { background: #fde8e4; color: #8b2a22; }
.lp-tv-side { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 16px; padding: 1.2rem; }
.lp-tv-side h3 { margin: 0 0 .7rem; font-size: 1.15rem; }
.lp-zl { display: grid; gap: .6rem; margin-bottom: 1rem; }
.lp-zrow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .lp-zrow b { flex: 1 1 100%; }
.lp-exrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .7rem; }
.lp-excard { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; }
.lp-excard img, .lp-exini { width: 4.2rem; height: 4.2rem; border-radius: 50%; object-fit: cover; border: 2px solid #e4c27b; display: grid; place-items: center; background: #fdecd0; color: var(--lp-red); font-weight: 800; }
.lp-excard b { font-size: .88rem; } .lp-excard small { font-size: .76rem; color: var(--lp-mute); }
/* khách hàng */
.lp-kstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.lp-kstat { background: #fff; border: 1px solid var(--lp-line); border-radius: 16px; padding: 1rem; text-align: center; }
.lp-kstat b { display: block; font: 800 2rem 'Noto Serif', Georgia, serif; color: var(--lp-red); } .lp-kstat span { color: var(--lp-mute); font-size: .9rem; }
.lp-klist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.lp-kcard { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--lp-line); border-radius: 14px; padding: .8rem 1rem; text-decoration: none; color: inherit; }
.lp-kcard:hover { border-color: #e4c27b; box-shadow: 0 6px 16px rgba(120, 70, 10, .1); }
.lp-kava { flex: none; width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, #a3271c, #7a1912); color: #ffe08a; font-weight: 800; }
.lp-ktx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lp-ktx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lp-ktx small { color: var(--lp-mute); }
.lp-kgo { color: var(--lp-red); font-weight: 800; font-size: .88rem; }
/* chân trang */
.lp-foot { margin-top: clamp(3rem, 7vw, 5rem); background: #2b1a0e; color: #f3e6cf; }
.lp-foot-in { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem) 1rem; display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.lp-foot-in b { font: 700 1.2rem 'Noto Serif', Georgia, serif; color: #ffd98a; } .lp-foot-in p { margin: .2rem 0; opacity: .85; font-size: .9rem; }
.lp-foot-acts { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lp-foot .lp-btn.ghost { background: transparent; color: #f3e6cf; border-color: #c9b18a; }
.lp-copy { text-align: center; margin: 0; padding: .8rem 1rem 1.2rem; font-size: .8rem; opacity: .7; border-top: 1px solid rgba(255, 255, 255, .1); }
.lp-login { display: grid; gap: 1rem; } .lp-login-pin { border-top: 1px dashed #e0d0b0; padding-top: .8rem; }
@media (max-width: 1180px) {
  .lp-feats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lp-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1rem; }
  .lp-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: #FAF6EE; border-bottom: 1px solid var(--lp-line); padding: .4rem 1rem .8rem; }
  .lp-links.open { display: flex; }
  .lp-burger { display: block; } .lp-top-acts { margin-left: auto; }
}
@media (max-width: 899px) {
  .lp-hero, .lp-demo, .lp-tv { grid-template-columns: minmax(0, 1fr); }
  .lp-steps, .lp-devs, .lp-kstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-klist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .lp-top { gap: .5rem; padding: .45rem .7rem; }
  .lp-brand small, .lp-top-acts .lp-btn:not(.ghost) { display: none; }
  .lp-brand b { font-size: 1rem; } .lp-brand img { width: 2.2rem; height: 2.2rem; }
  .lp-top-acts .lp-btn.sm { padding: 0 .6rem; font-size: .8rem; }
  .lp-hero h1 { font-size: 2.15rem; } .lp-lead { font-size: 1rem; }
  .lp-cta .lp-btn { flex: 1 1 100%; }
  .lp-clip-stage { height: 21rem; } .lp-scene { padding: 1rem; }
  .lp-pc { min-width: 0; } .lp-s-row.two { gap: .4rem; } .lp-s-row.two .lp-pc { flex: 1; } .lp-pc b { font-size: .8rem; }
  .lp-s-gio { flex-direction: column; text-align: center; } .lp-s-gio-tx { align-items: center; }
  .lp-s-map { flex-direction: column; } .lp-s-vn { max-height: 12rem; }
  .lp-feats, .lp-plans, .lp-klist, .lp-fgrid { grid-template-columns: minmax(0, 1fr); }
  .lp-steps, .lp-kstats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .lp-step { padding: 1rem; } .lp-num { margin-bottom: .6rem; }
  .lp-devs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-dcard { width: 6.6rem; padding: .5rem .3rem; } .lp-dcard b { font-size: .76rem; } .lp-dcard .lp-ava { width: 2.5rem; height: 2.5rem; }
  .lp-dline.l { transform: translateX(-3.6rem); }
  .lp-kstat b { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .lp-scene, .lp-pc, .lp-pado-r, .lp-q, .lp-res, .lp-s-gio-cal { transition: none; animation: none !important; } .lp-mic i, .lp-pulse, .lp-clip-bar .on i::after { animation: none !important; } }

/* 2.0.85: menu Gia phả — lọc nhãn tỉnh theo miền + sắp xếp thứ tự */
.nav-mien { display: flex; flex-wrap: nowrap; align-items: center; gap: .2rem; margin: .25rem 0 .35rem; padding: .3rem .3rem; border-radius: 12px; background: #fffaf0; border: 1px solid #ecd3a3; }
.nav-mien-c { flex: 1 1 auto; justify-content: center; min-width: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: .2rem; min-height: 2rem; padding: .1rem .42rem; border-radius: 999px; border: 1.5px solid #e3bf7a; background: #fff; color: #5a2d10; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.nav-mien-c small { min-width: 1rem; padding: 0 .25rem; border-radius: 999px; background: #f6e7c8; color: #5a2d10; font-size: .72rem; font-weight: 800; text-align: center; }
.nav-mien-c:hover, .nav-mien-c:focus-visible { border-color: #2f7d1e; outline: none; }
.nav-mien-c.on { background: #2f7d1e; border-color: #2f7d1e; color: #fff; }
.nav-mien-c.on small { background: rgba(255,255,255,.25); color: #fff; }
.nav-mien-sort { flex: none; display: inline-grid; place-items: center; margin-left: auto; width: 2rem; height: 2rem; padding: 0; border-radius: 999px; border: 1.5px solid #b8361f; background: #fff; color: #b8361f; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.nav-mien-sort:hover, .nav-mien-sort:focus-visible { background: #b8361f; color: #fff; outline: none; }
.nav-mien-sort .gn-i { width: 1rem; height: 1rem; }
.nav-mien-sort .gn-i svg { fill: currentColor; }
.nav-mien-h { display: flex; align-items: baseline; gap: .4rem; margin: .45rem .2rem .15rem; color: #2f7d1e; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nav-mien-h::after { content: ''; flex: 1; border-bottom: 1.5px dashed #b9d7a8; transform: translateY(-.2rem); }
.nav-mien-h small { order: 2; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.nav-mien-h::after { order: 1; }
.gs-dlg { display: flex; flex-direction: column; gap: .6rem; }
.gs-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.gs-quick .lbl { font-weight: 700; color: var(--text-2); margin-right: .2rem; }
.gs-list { display: flex; flex-direction: column; gap: .3rem; max-height: min(60vh, 32rem); overflow: auto; padding-right: .2rem; }
.gs-row { display: flex; align-items: center; gap: .35rem; padding: .35rem .5rem; border: 1.5px solid #ecd3a3; border-radius: 10px; background: #fff; }
.gs-row.dragging { opacity: .45; }
.gs-row.over { border-color: #2f7d1e; box-shadow: 0 0 0 2px #cfe8c2; }
.gs-grip { cursor: grab; color: #b48a4a; font-size: 1.2rem; line-height: 1; padding: 0 .15rem; user-select: none; }
.gs-no { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: #b8361f; color: #fff; font-weight: 800; font-size: .85rem; }
.gs-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.gs-nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-nm small { color: var(--muted); font-size: .8rem; }
.gs-row .btn.sm { min-width: 2.2rem; padding: .2rem .4rem; }
.gs-dirty { margin: 0; color: #b8361f; font-weight: 700; font-size: .9rem; }
@media (max-width: 560px) { .gs-row .btn.sm[title] { display: none; } }

/* 2.0.86: nhánh con ở nhãn tỉnh khác cây mẹ */
.nav-tinh-tag { flex: none; max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .35rem; border-radius: 999px; background: #e8f4e1; border: 1px solid #b9d7a8; color: #2f6b1e; font-size: .68rem; font-weight: 700; line-height: 1.35; }
.nav-from { margin: -.1rem 0 .15rem 1.35rem; color: var(--muted); font-size: .74rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-from a { color: #8a3a12; font-weight: 700; text-decoration: none; }
.nav-from a:hover { text-decoration: underline; }
.grp-row.sub { padding-left: calc(.5rem + var(--lv, 1) * 1.1rem); background: #fffdf8; }
.grp-row .grp-sub { color: #b48a4a; font-weight: 800; }
.nav-tinh-line { margin-top: -.15rem; }
.nav-tinh-line .nav-tinh-tag { display: inline-block; vertical-align: baseline; max-width: 8rem; }

/* 2.0.87: hộp Nhãn nhóm — xem theo nhánh mẹ / theo tỉnh, bung / thu gọn */
.gx-h { display: flex; align-items: center; gap: .45rem; }
.gx-bar { position: sticky; top: -1rem; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .2rem 0 .5rem; padding: .5rem; border-radius: 12px; background: #fff7e8; border: 1px solid #f0dcae; box-shadow: 0 2px 6px rgba(120,70,10,.08); }
.gx-seg { display: inline-flex; border: 1.5px solid #c8261f; border-radius: 10px; overflow: hidden; }
.gx-seg button { border: 0; background: #fff; color: #a3141a; font: inherit; font-weight: 800; padding: .3rem .65rem; cursor: pointer; white-space: nowrap; }
.gx-bar .btn.sm { white-space: nowrap; padding-inline: .6rem; }
.gx-seg button + button { border-left: 1.5px solid #c8261f; }
.gx-seg button.on { background: #a3141a; color: #fff; }
.gx-q { flex: 1 1 8rem; min-width: 7rem; min-height: 2.3rem; padding: .3rem .7rem; border: 1.5px solid #e2c48a; border-radius: 10px; background: #fff; font: inherit; }
.gx-tog { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .15rem; min-width: 1.9rem; height: 1.9rem; padding: 0 .35rem; border-radius: 999px; border: 1.5px solid #2f7d1e; background: #fff; color: #2f7d1e; font: inherit; font-weight: 900; font-size: 1rem; line-height: 1; cursor: pointer; }
.gx-tog small { font-size: .7rem; font-weight: 800; }
.gx-tog.on { background: #2f7d1e; color: #fff; }
.gx-tog.none { visibility: hidden; }
.grp-modal .gx-row { flex-wrap: nowrap; padding-left: calc(.5rem + var(--lv, 0) * 1.3rem); }
.grp-modal .gx-row.sub { background: #fffdf8; }
.grp-modal .gx-row.hit { box-shadow: inset 4px 0 0 #e0a400; background: #fff8dc; }
.gx-row .grp-tree { min-width: 0; }
.gx-row select { flex: none; max-width: 15rem; }
.gx-else { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; background: #e8f4e1; border: 1px solid #b9d7a8; color: #2f6b1e; font-size: .72rem; font-weight: 700; }
.gx-sec { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; padding: .45rem .6rem; border-radius: 10px; background: linear-gradient(180deg, #fdf3e2, #f7e6c8); border: 1px solid #e8cf94; color: #8a1d12; }
.gx-sec b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-sec small { color: #5a3a1a; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .grp-modal .gx-row { flex-wrap: wrap; } .gx-row select { max-width: none; flex: 1 1 100%; } }

/* 2.0.88: xem toàn màn hình ở Địa danh, Ký sự / Check-in, Hội - Lễ - Giỗ chạp, Thư viện */
.pgfs-btn { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.pgfs-btn .pgfs-ic { font-size: 1.1rem; line-height: 1; }
.gpg-head .pgfs-btn { margin-left: .5rem; }
html.pg-full:is([data-view="diadanh"], [data-view="kysu"], [data-view="gio"], [data-view="thuvien"]) .shell { --top-h: 0px; --nav-w: 0px; grid-template-columns: 1fr; grid-template-rows: 1fr; }
html.pg-full:is([data-view="diadanh"], [data-view="kysu"], [data-view="gio"], [data-view="thuvien"]) :is(.topbar, #nav, .nav-grip, .bnav, .zl-fab, .srv-warn) { display: none !important; }
html.pg-full:is([data-view="diadanh"], [data-view="kysu"], [data-view="gio"], [data-view="thuvien"]) #main :is(.site-foot, .pf-crumb, .pf-head, .pf-desc, .pf-foot, .gpg-banner) { display: none !important; }   /* 2.0.89: chỉ trong trang, không đụng cửa sổ nổi */
html.pg-full:is([data-view="diadanh"], [data-view="kysu"], [data-view="gio"], [data-view="thuvien"]) #main { grid-column: 1 / -1; grid-row: 1 / -1; height: 100vh; height: 100dvh; padding-top: .6rem; }
html.pg-full:is([data-view="diadanh"], [data-view="kysu"], [data-view="gio"], [data-view="thuvien"]) #main > .view { max-width: none; width: 100%; margin-top: 0; background-image: none; }
html.pg-full:is([data-view="diadanh"], [data-view="kysu"], [data-view="gio"], [data-view="thuvien"]) #main .pf-top { justify-content: flex-end; margin: 0 0 .5rem; padding: 0; }
html.pg-full .pgfs-btn { background: #a3141a; border-color: #a3141a; color: #fff; }
html.pg-full[data-view="thuvien"] #main .tg-head { display: none !important; }
html.pg-full[data-view="kysu"] .pf-right .ks-tabs { display: inline-flex !important; flex: none; width: auto; margin: 0 auto 0 0; border-radius: 12px; overflow: hidden; }
html.pg-full[data-view="kysu"] .pf-right .ks-tabs > * { flex: none; padding: .45rem 1rem; font-size: .95rem; }
html.pg-full[data-view="kysu"] .pf-top .pf-right { flex: 1; justify-content: flex-end; }
html.pg-full[data-view="kysu"] .pf-right .ks-tabs { border: 1.5px solid #2f7d1e; background: #fff; }
html.pg-full[data-view="kysu"] .pf-right .ks-tabs > button { background: #fff; color: #2f6b1e; font-weight: 800; border: 0; }
html.pg-full[data-view="kysu"] .pf-right .ks-tabs > button.on { background: #2f7d1e; color: #fff; }
@media (max-width: 599px) {
  html:not(.pg-full) .pgfs-btn .pgfs-t { display: none; }
  html:not(.pg-full) .pgfs-btn { padding: .3rem .65rem; min-width: 2.6rem; justify-content: center; }
  .pf-right:has(.pgfs-btn) { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
  html.pg-full .pf-top { margin-bottom: .4rem; }
}

/* 2.0.90: Gia phả trên điện thoại — thanh công cụ gọn, xoay ngang */
.tb-mob { display: none; }
.tb-mob-btn { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; color: var(--brand); display: grid; place-items: center; padding: 0; cursor: pointer; }
.tb-mob-btn:active { transform: scale(.94); }
.tb-mob-more[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 600px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  html[data-view="cay"] .tb-mob { display: inline-flex; align-items: center; gap: .3rem; margin-left: auto; flex: none; }
  html[data-view="cay"] .tb2.tb3 { gap: .25rem; padding: .35rem .45rem .3rem; }
  html[data-view="cay"] .tree-pick { flex-wrap: nowrap; align-items: center; gap: .35rem; padding: 0; min-height: 0; }
  html[data-view="cay"] .tree-pick :is(.tb2-tree, .tp-lbl, .spacer) { display: none; }
  html[data-view="cay"] .tree-pick :is(.tp-sel, .tp-name) { flex: 1 1 auto; min-width: 0; }
  html[data-view="cay"] .tree-pick .tp-sel select { font-size: 1.02rem; font-weight: 800; max-width: 100%; min-height: 2.4rem; text-overflow: ellipsis; }
  html[data-view="cay"] .tree-pick .tp-name b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html[data-view="cay"] .tree-pick .tp-cnt { flex: none; font-size: .78rem; padding: .15rem .5rem; }
  html[data-view="cay"] .tb2.tb3:not(.mob-open) .tree-pick :is(.tp-new, .tp-edit, .tp-sync, .tp-role, .tp-search) { display: none; }
  html[data-view="cay"] .tb3-r2 { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: .2rem 0; gap: .3rem; }
  html[data-view="cay"] .tb3-r2::-webkit-scrollbar { display: none; }
  html[data-view="cay"] .tb3-r2 .seg { flex: none; flex-wrap: nowrap; }
  html[data-view="cay"] .tb3-r2 .seg > button { flex: none; white-space: nowrap; min-height: 2.3rem; padding: .25rem .75rem; font-size: .95rem; }
  html[data-view="cay"] .tb2.tb3:not(.mob-open) .tb3-r2 > :not(.seg) { display: none; }
  html[data-view="cay"] .tb2.tb3:not(.mob-open) .tb3-r3 { display: none; }
  html[data-view="cay"] .tb2.tb3.mob-open .tb3-r2 { flex-wrap: wrap; overflow: visible; }
  html[data-view="cay"] .tb2.tb3.mob-open .tb3-r2 .seg { width: 100%; overflow-x: auto; scrollbar-width: none; }
  html[data-view="cay"] .tb2.tb3.mob-open .tb3-r3 { flex-wrap: wrap; gap: .3rem; }
}
/* điện thoại dựng đứng: chưa cần nút Trang chủ (đã có thanh dưới) */
@media (max-width: 600px) and (orientation: portrait) { html[data-view="cay"] .tb-mob-home { display: none; } }
/* điện thoại xoay ngang: ẩn thanh đầu, menu dọc, thanh dưới — sơ đồ chiếm gần hết màn hình; thanh công cụ còn 1 hàng */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  html[data-view="cay"] :is(.topbar, #nav, .nav-grip, .bnav, .zl-fab, .srv-warn) { display: none !important; }
  html[data-view="cay"] .shell { --top-h: 0px; --nav-w: 0px; grid-template-columns: 0 1fr 0px; grid-template-rows: 1fr; grid-template-areas: "nav main panel"; }
  html[data-view="cay"] .shell.panel-open { grid-template-columns: 0 1fr min(380px, 46vw); }
  html[data-view="cay"] .tb-mob-rot { display: none; }
  html[data-view="cay"] .tb2.tb3:not(.mob-open) { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: .4rem; padding: .25rem .4rem; }
  html[data-view="cay"] .tb2.tb3:not(.mob-open) .tree-pick { flex: 0 1 46%; min-width: 0; }
  html[data-view="cay"] .tb2.tb3:not(.mob-open) .tb3-r2 { flex: 1 1 0; min-width: 0; padding: 0; overflow-x: auto !important; }
  html[data-view="cay"] .tb2.tb3 .tree-pick .tp-cnt { display: none; }
  html[data-view="cay"] .tb2.tb3 .tree-pick .tp-sel select { min-height: 2.2rem; font-size: .95rem; }
  html[data-view="cay"] .tb3-r2 .seg > button { min-height: 2.1rem; padding: .2rem .65rem; font-size: .9rem; }
  html[data-view="cay"] .tb-mob-btn { width: 2.2rem; height: 2.2rem; }
  html[data-view="cay"] .tree-scroll.pado-host :is(.pv-fab, .zoom-fab, .pado-fab) { transform: scale(.8); transform-origin: bottom right; }
}
/* hướng dẫn xoay ngang (iPhone / iPad) */
.rot-hint { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.2rem; background: rgba(30,12,4,.55); }
.rot-card { width: min(22rem, 100%); border-radius: 18px; background: #fffaf0; border: 2px solid #e8c77a; box-shadow: 0 12px 40px rgba(0,0,0,.35); padding: 1.2rem 1.1rem 1rem; text-align: center; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.rot-card b { font-size: 1.25rem; color: var(--brand); }
.rot-card p { margin: 0; line-height: 1.45; }
.rot-card .btn { width: 100%; margin-top: .3rem; }
.rot-off { display: inline-flex; gap: .4rem; align-items: center; font-size: .95rem; }
.rot-ph { width: 4.2rem; height: 4.2rem; display: grid; place-items: center; }
.rot-ph span { width: 1.9rem; height: 3.2rem; border: 3px solid var(--brand); border-radius: 7px; position: relative; animation: rotph 2.4s ease-in-out infinite; }
.rot-ph span::after { content: ''; position: absolute; left: 50%; bottom: .2rem; width: .35rem; height: .35rem; margin-left: -.175rem; border-radius: 50%; background: var(--brand); }
@keyframes rotph { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .rot-ph span { animation: none; transform: rotate(-90deg); } }
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  html[data-view="cay"] .pado-ctl { transform: scale(.68); transform-origin: right bottom; }
  html[data-view="cay"] .pado-hint { font-size: .8rem; padding: .25rem .7rem; max-width: 70%; }
}
@media (max-width: 600px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  html[data-view="cay"] .tb2.tb3.mob-open .tree-pick { flex-wrap: wrap; row-gap: .35rem; }
  html[data-view="cay"] .tb2.tb3.mob-open .tree-pick :is(.tp-sel, .tp-name) { flex: 1 1 55%; }
  html[data-view="cay"] .tree-pick :is(.tp-new, .tp-edit, .tp-sync) { white-space: nowrap; min-height: 2.3rem; padding: .2rem .7rem; font-size: .9rem; }
}
@media (max-width: 600px) {
  html[data-view="cay"] .tb2.tb3.mob-open .tree-pick :is(.tp-new, .tp-edit, .tp-sync) { order: 5; }
}

/* 2.0.91: Thông tin tổng quan của cây / nhánh */
.tq-wrap { padding: .2rem 0 1.5rem; }
.tq-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .8rem; padding: .55rem .65rem; border-radius: 14px; background: #fff7e8; border: 1px solid #f0dcae; }
.tq-sp { flex: 1; }
.tq-cd { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--text-2); }
.tq-cd select { min-height: 2.3rem; border-radius: 10px; border: 1.5px solid #e2c48a; background: #fff; font: inherit; font-weight: 700; padding: .2rem .5rem; }
.tq { max-width: 1100px; margin: 0 auto; background: #fffaf0; border: 2px solid #e8c77a; border-radius: 20px; overflow: hidden; box-shadow: 0 6px 24px rgba(120,60,10,.12); }
.tq-head { padding: 1.4rem 1.2rem 1.1rem; text-align: center; color: #fff; background: linear-gradient(180deg, #b3201f, #7d0f12); border-bottom: 6px solid #d9a62e; }
.tq-kick { font-size: .8rem; font-weight: 800; letter-spacing: .12em; color: #ffd98a; }
.tq-ttl { margin: .3rem 0 .2rem; font: 800 clamp(1.5rem, 3.2vw, 2.3rem)/1.2 var(--gp-serif); color: #fff; }
.tq-sub { margin: 0 0 .4rem; font: italic 1rem var(--gp-serif); color: #ffe9b8; }
.tq-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-top: .5rem; }
.tq-tags span { padding: .15rem .65rem; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,217,138,.5); font-size: .85rem; color: #ffecc0; }
.tq-tags b { color: #fff; }
.tq-root { display: flex; gap: 1.1rem; align-items: flex-start; margin: 1.1rem; padding: 1rem 1.1rem; border-radius: 16px; background: #fff; border: 2px solid #ecd3a3; }
.tq-root .tq-kick { color: var(--muted); }
.tq-av { flex: none; width: 6.5rem; height: 6.5rem; border-radius: 50%; overflow: hidden; background: #f6e3b8; border: 3px solid #d9a62e; display: grid; place-items: center; }
.tq-av img { width: 100%; height: 100%; object-fit: cover; }
.tq-av span { font: 800 2.6rem var(--gp-serif); color: #a3141a; }
.tq-rt { min-width: 0; flex: 1; }
.tq-rn { display: block; margin: .15rem 0 .25rem; padding: 0; border: 0; background: none; font: 800 1.6rem/1.2 var(--gp-serif); color: #a3141a; text-align: left; cursor: pointer; }
b.tq-rn { cursor: default; }
button.tq-rn:hover { text-decoration: underline; }
.tq-rm { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-weight: 700; color: var(--text); }
.tq-rm2 { margin-top: .2rem; color: var(--muted); }
.tq-ts { margin: .5rem 0 0; line-height: 1.55; color: var(--text); }
.tq-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .7rem; margin: 0 1.1rem 1rem; }
.tq-tile { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: .6rem; align-items: center; padding: .75rem .85rem .75rem 1rem; border-radius: 14px; background: #fff; border: 1.5px solid #ecd3a3; }
.tq-tile::before { content: ''; position: absolute; left: 0; top: .8rem; bottom: .8rem; width: 4px; border-radius: 4px; background: #d9a62e; }
.tq-ic { grid-row: 1 / 3; font-size: 1.7rem; }
.tq-tile b { font-size: 1.45rem; color: #a3141a; line-height: 1.1; }
.tq-tile > span:not(.tq-ic) { font-weight: 800; color: var(--text); }
.tq-tile small { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.tq-sec { margin: 0 1.1rem 1rem; padding: .9rem 1rem; border-radius: 16px; background: #fff; border: 1.5px solid #ecd3a3; min-width: 0; }
.tq-h { margin: 0 0 .65rem; font: 800 1.2rem var(--gp-serif); color: #a3141a; display: flex; align-items: center; gap: .5rem; }
.tq-h::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, #d9a62e, transparent); }
.tq-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0; }
.tq-2col > .tq-sec { margin-right: 1.1rem; }
.tq-gen { display: flex; flex-direction: column; gap: .35rem; }
.tq-gr { display: grid; grid-template-columns: 4.2rem 1fr 3rem; align-items: center; gap: .5rem; }
.tq-gl { font-weight: 800; color: var(--text-2); }
.tq-gb { display: flex; height: 1.15rem; border-radius: 6px; overflow: hidden; background: #f6ecd8; }
.tq-gb i, .tq-leg i { display: block; height: 100%; }
.tq-gb i.m, .tq-leg i.m { background: #a9480f; }
.tq-gb i.f, .tq-leg i.f { background: #5aa64a; }
.tq-gb i.d, .tq-leg i.d { background: #d9a62e; }
.tq-gn { color: #a3141a; }
.tq-leg { display: flex; gap: 1rem; margin-top: .6rem; color: var(--muted); font-size: .85rem; }
.tq-leg span { display: inline-flex; align-items: center; gap: .35rem; }
.tq-leg i { width: 1rem; height: .8rem; border-radius: 3px; }
.tq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tq-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed #ecd3a3; }
.tq-list li:last-child { border-bottom: 0; }
.tq-li { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.tq-li small { color: var(--muted); }
.tq-lnk { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.tq-lnk:hover b { text-decoration: underline; }
.tq-date { flex: none; min-width: 3.4rem; padding: .25rem .4rem; border-radius: 10px; background: #a3141a; color: #fff; font-weight: 800; text-align: center; }
.tq-left { flex: none; font-size: .82rem; font-weight: 800; color: #2f7d1e; white-space: nowrap; }
.tq-left.soon { color: #c8261f; }
.tq-tt { margin: 0 0 .5rem; font-weight: 700; }
.tq-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.tq-chip { display: inline-flex; flex-direction: column; align-items: flex-start; padding: .35rem .7rem; border-radius: 12px; background: #fff7dc; border: 1.5px solid #e8c77a; font: inherit; text-align: left; }
button.tq-chip { cursor: pointer; }
.tq-chip small { color: var(--muted); }
.tq-foot { padding: .8rem 1rem 1.1rem; text-align: center; color: var(--muted); font: italic .9rem var(--gp-serif); border-top: 2px solid #ecd3a3; margin: 0 1.1rem; }
/* trang công khai tong-quan.php */
body.tq-page { margin: 0; background: #f4ead6; min-height: 100vh; }
.tq-pwrap { max-width: 1140px; margin: 0 auto; padding: .8rem .7rem 2rem; }
.tq-pbar { position: sticky; top: .4rem; z-index: 5; box-shadow: 0 3px 12px rgba(120,60,10,.12); }
.tq-deny { max-width: 30rem; margin: 15vh auto; padding: 1.6rem 1.3rem; text-align: center; border-radius: 18px; background: #fffaf0; border: 2px solid #e8c77a; }
.tq-deny b { font-size: 1.3rem; color: #a3141a; }
@media (max-width: 600px) {
  .tq-root { flex-direction: column; align-items: center; text-align: center; margin: .8rem; }
  .tq-rn { text-align: center; } .tq-rm { justify-content: center; }
  .tq-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 .8rem .8rem; gap: .5rem; }
  .tq-tile { padding: .6rem .6rem .6rem .8rem; } .tq-tile b { font-size: 1.2rem; } .tq-ic { font-size: 1.35rem; }
  .tq-sec, .tq-2col > .tq-sec { margin: 0 .8rem .8rem; }
  .tq-2col { grid-template-columns: 1fr; }
  .tq-bar .btn.sm { flex: 1 1 auto; justify-content: center; }
}
@media print {
  body.tq-page { background: #fff; }
  .tq-pbar, #toast-root { display: none !important; }
  .tq-pwrap { padding: 0; max-width: none; }
  .tq { box-shadow: none; border-width: 1px; }
  .tq-head, .tq-gb i, .tq-date, .tq-tile::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tq-sec, .tq-tile, .tq-root { break-inside: avoid; }
}
@media (max-width: 600px) {
  .tq-tile { grid-template-columns: auto 1fr; column-gap: .4rem; }
  .tq-tile .tq-ic { grid-row: 1; font-size: 1.15rem; }
  .tq-tile > span:not(.tq-ic) { grid-column: 1 / -1; line-height: 1.25; }
  .tq-list li { flex-wrap: wrap; }
}
/* 2.0.92: phông có dấu tiếng Việt cho trang tổng quan (Georgia trên Windows ra "Sô´") */
.tq, .tq-wrap, body.tq-page { --gp-serif: "Noto Serif", "Times New Roman", "Tinos", serif; }

/* 2.0.102: nút ẩn / hiện thanh công cụ gia phả (máy tính) */
.tb-hide-btn { flex: none; }
@media (min-width: 600px) and (min-height: 501px), (min-width: 600px) and (pointer: fine) {
  .tb3.tb-hide .tb3-r2, .tb3.tb-hide .tb3-r3 { display: none !important; }
}
@media (max-width: 599px), (max-height: 500px) and (orientation: landscape) and (pointer: coarse) { .tb-hide-btn { display: none !important; } }
/* 2.0.103: ô chọn màu nhánh tròn */
.nm-chips .nm-chip.nm-mau { min-width: 0; flex: none; padding: 0; }
/* 2.0.109: thanh công cụ gia phả dạng menu dọc (cột trái) — chỉ máy tính */
@media (min-width: 900px) {
  .view.full.tb-side { position: relative; padding-left: 18rem; }
  .view.full.tb-side > .tb3 { position: absolute; left: .4rem; top: .4rem; bottom: .4rem; width: 17.2rem; margin: 0 !important; overflow-y: auto; overflow-x: hidden; z-index: 5; display: flex; flex-direction: column; }
  .tb-side > .tb3 > * { flex: none !important; }
  .tb-side > .tb3 .tree-pick { flex-direction: column; align-items: stretch; flex-wrap: nowrap !important; gap: .45rem; border-radius: 14px 14px 0 0; }
  .tb-side > .tb3 .tree-pick > .spacer { display: none; }
  .tb-side > .tb3 .tree-pick > .tp-cnt { align-self: flex-start; }
  .tb-side > .tb3 .tree-pick > * { max-width: 100%; }
  .tb-side > .tb3 .tree-pick .btn.sm { width: 100%; justify-content: center; }
  .tb-side > .tb3 .tp-sel select { max-width: 100%; }
  .tb-side > .tb3 .tree-bar { flex-direction: column; align-items: stretch; flex-wrap: nowrap !important; gap: .35rem; padding: .55rem .6rem; overflow: visible !important; }
  .tb-side > .tb3 .tree-bar > * { width: 100%; max-width: 100%; }
  .tb-side > .tb3 .tree-bar .spacer { display: none; }
  .tb-side > .tb3 .tree-bar .btn.sm, .tb-side > .tb3 .tb3-dd { justify-content: flex-start; width: 100%; }
  .tb-side > .tb3 .tb3-dd { display: flex; }
  .tb-side > .tb3 .tree-bar .seg, .tb-side > .tb3 .tree-bar [role="tablist"] { display: flex; flex-wrap: wrap; gap: .3rem; }
  .tb-side > .tb3 .tree-bar .seg > *, .tb-side > .tb3 .tree-bar [role="tablist"] > * { flex: 1 1 45%; }
  .tb-side .tb-side-btn[aria-pressed="true"] { background: #fff4e0; border-color: #e2b46a; }
}
@media (max-width: 899px) { .tb-side-btn { display: none !important; } }
/* 2.0.118: tay nắm khối sơ đồ — mờ, rê chuột vào phả đồ thì rõ */
.pado .pd-tks { opacity: .28; transition: opacity .2s; }
.pado:hover .pd-tks, .pado .pd-tks:hover { opacity: 1; }
.pado .pd-tks.locked .pd-tkbox { display: none; }

/* 2.0.121: chọn tông màu */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: .55rem; margin: .4rem 0 .2rem; }
.th-it { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; padding: .45rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.th-it:hover { border-color: var(--line-strong); }
.th-it.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,134,11,.25); }
.th-sw { display: flex; height: 2.1rem; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.12); }
.th-sw i { flex: 1; }
.th-sw i:last-child { flex: .5; background: #e6b155; }
.th-it b { font-size: .95rem; line-height: 1.2; }
.th-it small { font-size: .74rem; color: var(--text-2); line-height: 1.25; }
.th-cus { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.th-cus input[type=color] { width: 3rem; height: 2.4rem; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.th-site { margin-top: .7rem; padding: .6rem .7rem; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }

/* 2.0.122: thanh chạy sự kiện ở dưới đáy màn hình / ẩn */
html.tk-an .top-ticker, html.tk-an .tk-dock { display: none !important; }
html.tk-an .topbar.has-ticker .brand { max-width: none; }
.tk-mv { flex: none; width: 1.9rem; height: 1.9rem; margin-left: .3rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--brand-dark); font-size: .95rem; font-weight: 900; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tk-mv:hover { background: #fff3dc; }
html { --tkd-h: 2.9rem; }
.tk-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 24; height: var(--tkd-h); display: flex; align-items: center; gap: .35rem;
  padding: .3rem .6rem calc(.3rem + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #8e0d12, #6d0a0e); border-top: 2px solid #e6b155;
  box-shadow: 0 -3px 12px rgba(80, 10, 0, .25); }
.tk-dock[hidden] { display: none; }
.tk-dock .top-ticker { flex: 1 1 auto; width: auto; height: 100%; margin: 0; border-radius: 999px; background: rgba(0, 0, 0, .22); font-size: .95rem; }
.tk-dock .tk-mv { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12); color: #ffd84d; }
.tk-dock .tk-mv:hover { background: rgba(255, 255, 255, .25); }
html.tk-duoi .shell { height: calc(100vh - var(--tkd-h)); height: calc(100dvh - var(--tkd-h)); }
html.tk-duoi .zl-fab, html.tk-duoi .fs-float, html.tk-duoi .toast, html.tk-duoi .wide-ctl { translate: 0 calc(-1 * var(--tkd-h)); }
html.tree-fs .tk-dock, html.lp-on .tk-dock, html.dev-lock .tk-dock { display: none !important; }
html.tree-fs.tk-duoi .shell { height: 100vh; height: 100dvh; }
html.lp-on.tk-duoi .shell { height: auto; }
html.tree-fs.tk-duoi .zl-fab, html.tree-fs.tk-duoi .fs-float, html.tree-fs.tk-duoi .wide-ctl { translate: none; }
@media print { .tk-dock { display: none !important; } html.tk-duoi .shell { height: auto; } }
.tkp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; }
.tkp-b { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .5rem .7rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.tkp-b.on { border-color: var(--gold); background: #fff8e6; box-shadow: 0 0 0 3px rgba(184,134,11,.2); }
.tkp-b small { font-size: .76rem; color: var(--text-2); }

/* 2.0.123: nút bật lại thanh chạy sự kiện khi đang ẩn */
.tk-mv.tk-show { width: auto; height: 2rem; padding: 0 .75rem; margin-left: auto; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }

/* 2.0.125: khối "Nhánh dưới" thu gọn / mở rộng, kéo mép dưới đổi chiều cao */
.below-box { display: block; position: relative; padding-bottom: .2rem; }
.below-box .below-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.below-box .below-head .lbl { flex: 1 1 auto; }
.below-box .below-tog { flex: none; }
.below-list { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.below-box.gon .below-list { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding-bottom: .3rem; }
.below-box.gon .below-chip { flex: none; white-space: nowrap; }
.below-grip { height: 12px; margin: .25rem auto 0; width: 64px; border-radius: 6px; cursor: ns-resize; touch-action: none; position: relative; }
.below-grip::before { content: ''; position: absolute; left: 14px; right: 14px; top: 3px; border-top: 2px solid #8fbcc6; border-bottom: 2px solid #8fbcc6; height: 2px; }
.below-grip:hover, .below-grip:focus-visible { background: #e3f1f4; outline: none; }

/* ===== 2.0.127: thanh công cụ gia phả 3 nhóm — Xem và trình bày · Thiết kế mẫu gia phả · Xuất bản và lưu trữ ===== */
.tbg-ic { display: inline-grid; place-items: center; flex: none; width: 1.25rem; height: 1.25rem; }
.tbg-ic svg { width: 100%; height: 100%; display: block; }
.tb3.tb-hide .tbg-wrap { display: none !important; }
@media (max-width: 899px) {   /* điện thoại / máy tính bảng: giữ cách gọn cũ (chỉ hiện kiểu xem, ⚙ mở tùy chọn) */
  .tbg-wrap, .tbg { display: contents; }
  .tbg-h, .tbg-more { display: none !important; }
}
.tb-side .tbg-wrap, .tb-side .tbg { display: contents; }
.tb-side .tbg-h, .tb-side .tbg-more { display: none !important; }
@media (min-width: 900px) {
  .view.full:not(.tb-side) > .tb3 { background: linear-gradient(180deg, #fffaf1, #fff6e6); border-color: #f1ddb4; border-radius: 22px; box-shadow: 0 6px 22px rgba(150, 90, 20, .10); }
  /* hàng trên: tên cây + các nút */
  .view.full:not(.tb-side) > .tb3 .tree-pick { padding: .75rem 1.1rem .55rem; gap: .65rem; background: transparent; border: 0; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tb2-tree.tbg-tree { width: 3.1rem; height: 3.1rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tb2-tree.tbg-tree svg { width: 3.1rem; height: 3.1rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-lbl { color: #e2621b; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: .9rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-sel select, .view.full:not(.tb-side) > .tb3 .tree-pick .tp-name b { font-size: 1.35rem; font-weight: 800; color: #2a2118; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-role { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem 1rem; border-radius: 999px; border: 1.5px solid #b9cdf3; background: #f4f8ff; color: #1d4fa8; font-weight: 600; box-shadow: 0 2px 6px rgba(29, 79, 168, .08); }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-cnt { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 999px; background: #e4f5e2; color: #1f7a33; font-weight: 800; border: 0; }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: 0 1.05rem; border-radius: 999px; font-size: .95rem; font-weight: 700;
    background: #fff; color: #a3141a; border: 1.5px solid #e8a9a3; box-shadow: 0 2px 6px rgba(163, 20, 26, .08); }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm:hover { border-color: #c8261f; background: #fff5f3; }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm.tp-new { background: linear-gradient(180deg, #e3262c, #b3121a); color: #fff; border-color: #b3121a; box-shadow: 0 4px 12px rgba(179, 18, 26, .3); }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm .t { display: inline !important; }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm .ic { width: 1.1rem; height: 1.1rem; }
  /* 3 nhóm */
  .view.full:not(.tb-side) .tbg-wrap { display: grid; gap: .6rem; padding: .2rem .7rem .75rem; }
  .view.full:not(.tb-side) .tbg { display: flex; align-items: stretch; gap: .7rem; padding: .5rem; border-radius: 20px; background: rgba(255, 255, 255, .7); border: 1px solid #efe2c8; box-shadow: 0 3px 12px rgba(120, 80, 20, .07); }
  .view.full:not(.tb-side) .tbg-view { background: linear-gradient(180deg, #f7f9ff, #eef3fe); border-color: #dce5fa; }
  .view.full:not(.tb-side) .tbg-design { background: linear-gradient(180deg, #fffaf0, #fff3df); border-color: #f5e0b8; }
  .view.full:not(.tb-side) .tbg-pub { background: linear-gradient(180deg, #f5fcf6, #ebf7ee); border-color: #cfead6; }
  .view.full:not(.tb-side) .tbg-h { flex: none; width: 13rem; display: flex; align-items: center; gap: .7rem; border: 0; border-radius: 15px; padding: .55rem .9rem; color: #fff; cursor: pointer;
    font: inherit; font-size: 1.12rem; font-weight: 800; line-height: 1.2; text-align: left; position: relative; overflow: hidden; }
  .view.full:not(.tb-side) .tbg-h::after { content: ""; position: absolute; inset: auto -10% -40% 30%; height: 70%; background: radial-gradient(closest-side, rgba(255, 255, 255, .18), transparent); pointer-events: none; }
  .view.full:not(.tb-side) .tbg-view .tbg-h { background: linear-gradient(135deg, #2f80f5, #0c4fc0); box-shadow: 0 6px 14px rgba(12, 79, 192, .3); }
  .view.full:not(.tb-side) .tbg-design .tbg-h { background: linear-gradient(135deg, #ffc43d, #f08a12); box-shadow: 0 6px 14px rgba(240, 138, 18, .3); }
  .view.full:not(.tb-side) .tbg-pub .tbg-h { background: linear-gradient(135deg, #2faa5d, #187a3b); box-shadow: 0 6px 14px rgba(24, 122, 59, .3); }
  .view.full:not(.tb-side) .tbg:not(.open) .tbg-h { min-height: 2.9rem; padding-top: .35rem; padding-bottom: .35rem; }
  .view.full:not(.tb-side) .tbg-hic { width: 2.1rem; height: 2.1rem; flex: none; }
  .view.full:not(.tb-side) .tbg-hic svg { width: 100%; height: 100%; display: block; }
  .view.full:not(.tb-side) .tbg-ht { flex: 1; min-width: 0; }
  .view.full:not(.tb-side) .tbg-car { font-size: 1.25rem; line-height: 1; opacity: .95; }
  .view.full:not(.tb-side) .tbg-b { flex: 1 1 0; min-width: 0; display: flex !important; flex-wrap: wrap !important; align-items: center; align-content: center; gap: .5rem !important;
    padding: .25rem .15rem !important; margin: 0 !important; border: 0 !important; background: transparent !important; overflow: visible !important; }
  .view.full:not(.tb-side) .tbg:not(.open) .tbg-b { flex-wrap: nowrap !important; overflow: hidden !important; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
  .view.full:not(.tb-side) .tbg-b .spacer { display: none; }
  .view.full:not(.tb-side) .tbg .seg { display: contents; }
  /* các nút: thẻ trắng bo tròn, biểu tượng màu */
  .view.full:not(.tb-side) .tbg .seg > button, .view.full:not(.tb-side) .tbg-b > .btn.sm, .view.full:not(.tb-side) .tbg-b > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .bgp > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .kg > .tb3-dd {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; height: auto; padding: .3rem 1rem; border-radius: 15px; border: 1px solid #e3e8f3; background: #fff; color: #1f2a44;
    font-size: .95rem; font-weight: 700; line-height: 1.15; white-space: nowrap; box-shadow: 0 2px 7px rgba(30, 60, 120, .08); flex: none; }
  .view.full:not(.tb-side) .tbg-design .tbg-b > .btn.sm, .view.full:not(.tb-side) .tbg-design .tbg-b > .tb3-dd, .view.full:not(.tb-side) .tbg-design .tbg-b > .bgp > .tb3-dd { border-color: #f3e2c2; box-shadow: 0 2px 7px rgba(170, 110, 20, .1); }
  .view.full:not(.tb-side) .tbg-pub .tbg-b > .btn.sm { border-color: #d6ecdc; box-shadow: 0 2px 7px rgba(24, 122, 59, .1); }
  .view.full:not(.tb-side) .tbg .seg > button:hover, .view.full:not(.tb-side) .tbg-b > .btn.sm:hover:not(:disabled), .view.full:not(.tb-side) .tbg-b > .tb3-dd:hover, .view.full:not(.tb-side) .tbg-b > .bgp > .tb3-dd:hover {
    transform: translateY(-1px); box-shadow: 0 5px 12px rgba(30, 60, 120, .14); }
  .view.full:not(.tb-side) .tbg-b .t { display: inline !important; }
  .view.full:not(.tb-side) .tbg .seg > button.on, .view.full:not(.tb-side) .tbg .seg > button.cat-tab.on { background: linear-gradient(180deg, #fff, #f3e9ff); border-color: #cdb8f2; color: #3b1d8a; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
  .view.full:not(.tb-side) .tbg .seg > button .tbg-ic { width: 1.35rem; height: 1.35rem; }
  .view.full:not(.tb-side) .tbg-b > .btn.sm[aria-pressed="true"] { background: linear-gradient(180deg, #f3fff4, #e3f6e6); border-color: #a9dcb4; color: #17602d; }
  .view.full:not(.tb-side) .tbg-b > .btn.sm[aria-pressed="true"] .tbg-ic::after { content: ""; }
  .view.full:not(.tb-side) .tbg-b > .btn.sm:disabled { opacity: .55; }
  .view.full:not(.tb-side) .tbg-b > .btn.sm.tb-share { background: linear-gradient(180deg, #23a356, #167a3c); border-color: #167a3c; color: #fff; }
  .view.full:not(.tb-side) .tbg-b .dd-car { color: #6b7280; font-size: .8rem; }
  .view.full:not(.tb-side) .tbg-b > .tb3-zoom { display: inline-flex; gap: .3rem; }
  .view.full:not(.tb-side) .tbg-b > .tb3-zoom .btn.sm { width: 2.75rem; min-height: 2.75rem; border-radius: 50%; background: #fff; border: 1px solid #e3e8f3; justify-content: center; padding: 0; }
  .view.full:not(.tb-side) .tbg-more { flex: none; align-self: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid #f0d9a8; background: #fff; color: #e08a10; font-size: 1.3rem; line-height: 1; cursor: pointer;
    box-shadow: 0 3px 8px rgba(150, 100, 20, .15); display: grid; place-items: center; }
  .view.full:not(.tb-side) .tbg-pub .tbg-more { border-color: #bfe3c9; color: #187a3b; }
  .view.full:not(.tb-side) .tbg-view .tbg-more { border-color: #c8d7f6; color: #0c4fc0; }
  .view.full:not(.tb-side) .tbg.open .tbg-more { display: none; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .view.full:not(.tb-side) .tbg-h { width: 10.5rem; font-size: 1rem; }
  .view.full:not(.tb-side) .tbg .seg > button, .view.full:not(.tb-side) .tbg-b > .btn.sm, .view.full:not(.tb-side) .tbg-b > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .bgp > .tb3-dd { min-height: 2.4rem; padding: .25rem .75rem; font-size: .88rem; }
}
@media (min-width: 900px) { .view.full:not(.tb-side) .tbg .seg > button.on::before { content: none; } }
.view.full:not(.tb-side) .tree-pick .tb-hide-btn .t { display: inline !important; }
.tb-side .tbg-b { flex: none !important; }

/* ===== 2.0.128: thanh công cụ gọn hơn (biểu tượng, nút, thẻ tiêu đề nhỏ lại); nhóm Thiết kế / Xuất bản ẩn hẳn thành nút "+" ===== */
@media (min-width: 900px) {
  .view.full:not(.tb-side) > .tb3 .tree-pick { padding: .5rem .9rem .4rem; gap: .5rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tb2-tree.tbg-tree, .view.full:not(.tb-side) > .tb3 .tree-pick .tb2-tree.tbg-tree svg { width: 2.4rem; height: 2.4rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-lbl { font-size: .78rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-sel select, .view.full:not(.tb-side) > .tb3 .tree-pick .tp-name b { font-size: 1.15rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm { min-height: 2.15rem; padding: 0 .8rem; font-size: .85rem; gap: .35rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-role, .view.full:not(.tb-side) > .tb3 .tree-pick .tp-cnt { padding: .3rem .8rem; font-size: .85rem; }
  .view.full:not(.tb-side) > .tb3 .tbg-ic { width: 1rem; height: 1rem; }
  .view.full:not(.tb-side) .tbg-wrap { display: flex; flex-wrap: wrap; gap: .4rem; padding: .1rem .6rem .55rem; }
  .view.full:not(.tb-side) .tbg { flex: 1 1 100%; gap: .5rem; padding: .3rem; border-radius: 14px; }
  .view.full:not(.tb-side) .tbg-h { width: 10.2rem; gap: .5rem; padding: .35rem .65rem; border-radius: 11px; font-size: .88rem; }
  .view.full:not(.tb-side) .tbg:not(.open) .tbg-h { min-height: 2.25rem; padding-top: .25rem; padding-bottom: .25rem; }
  .view.full:not(.tb-side) .tbg-hic { width: 1.45rem; height: 1.45rem; }
  .view.full:not(.tb-side) .tbg-car { font-size: 1.1rem; font-weight: 800; }
  .view.full:not(.tb-side) .tbg-b { gap: .35rem !important; padding: .1rem 0 !important; }
  .view.full:not(.tb-side) .tbg .seg > button, .view.full:not(.tb-side) .tbg-b > .btn.sm, .view.full:not(.tb-side) .tbg-b > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .bgp > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .kg > .tb3-dd {
    min-height: 2.1rem; padding: .15rem .7rem; gap: .35rem; border-radius: 11px; font-size: .84rem; box-shadow: 0 1px 4px rgba(30, 60, 120, .07); }
  .view.full:not(.tb-side) .tbg .seg > button .tbg-ic { width: 1.05rem; height: 1.05rem; }
  .view.full:not(.tb-side) .tbg-b > .tb3-zoom .btn.sm { width: 2.1rem; min-height: 2.1rem; }
  .view.full:not(.tb-side) .tbg-more { width: 2rem; height: 2rem; font-size: 1rem; }
  /* nhóm ẩn hẳn: chỉ còn nút "+ tên nhóm" (2 nhóm nằm cạnh nhau) */
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) { flex: 0 0 auto; padding: 0; background: none !important; border: 0; box-shadow: none; }
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-b, .view.full:not(.tb-side) .tbg.tbg-an .tbg-more { display: none !important; }
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-h { width: auto; min-height: 2rem; padding: .2rem .7rem .2rem .5rem; gap: .4rem; font-size: .84rem; border-radius: 999px; }
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-hic { width: 1.15rem; height: 1.15rem; }
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-ht br { display: none; }
  .view.full:not(.tb-side) .tbg.tbg-an .tbg-car { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: rgba(255, 255, 255, .25); font-size: 1rem; line-height: 1; }
}
@media (min-width: 900px) { .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-ht { white-space: nowrap; } }

/* ===== 2.0.129: thanh công cụ gọn tối đa ===== */
@media (min-width: 900px) {
  .view.full:not(.tb-side) > .tb3 .tree-pick { padding: .3rem .7rem .25rem; gap: .4rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tb2-tree.tbg-tree, .view.full:not(.tb-side) > .tb3 .tree-pick .tb2-tree.tbg-tree svg { width: 1.9rem; height: 1.9rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-lbl { font-size: .68rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-sel select, .view.full:not(.tb-side) > .tb3 .tree-pick .tp-name b { font-size: 1rem; }
  .view.full:not(.tb-side) > .tb3 .tree-pick > .btn.sm { min-height: 1.8rem; padding: 0 .6rem; font-size: .78rem; gap: .3rem; border-width: 1px; }
  .view.full:not(.tb-side) > .tb3 .tree-pick .tp-role, .view.full:not(.tb-side) > .tb3 .tree-pick .tp-cnt { padding: .15rem .6rem; font-size: .78rem; border-width: 1px; }
  .view.full:not(.tb-side) > .tb3 .tbg-ic { width: .85rem; height: .85rem; }
  .view.full:not(.tb-side) .tbg-wrap { gap: .3rem; padding: 0 .5rem .4rem; align-items: center; }
  .view.full:not(.tb-side) .tbg { gap: .35rem; padding: .2rem; border-radius: 11px; }
  /* 2 nhóm dưới đang ẩn → nằm chung hàng với nhóm Xem (bên phải) */
  .view.full:not(.tb-side) .tbg-wrap:not(:has(.tbg-an.open)) > .tbg-view { flex: 1 1 0; min-width: 0; }
  .view.full:not(.tb-side) .tbg-h { width: 7.6rem; gap: .35rem; padding: .2rem .5rem; border-radius: 9px; font-size: .76rem; line-height: 1.15; }
  .view.full:not(.tb-side) .tbg:not(.open) .tbg-h { min-height: 1.8rem; padding-top: .1rem; padding-bottom: .1rem; }
  .view.full:not(.tb-side) .tbg-hic { width: 1.15rem; height: 1.15rem; }
  .view.full:not(.tb-side) .tbg-car { font-size: .95rem; }
  .view.full:not(.tb-side) .tbg-b { gap: .25rem !important; padding: 0 !important; }
  .view.full:not(.tb-side) .tbg .seg > button, .view.full:not(.tb-side) .tbg-b > .btn.sm, .view.full:not(.tb-side) .tbg-b > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .bgp > .tb3-dd, .view.full:not(.tb-side) .tbg-b > .kg > .tb3-dd {
    min-height: 1.75rem; padding: .05rem .5rem; gap: .25rem; border-radius: 8px; font-size: .77rem; font-weight: 650; box-shadow: none; }
  .view.full:not(.tb-side) .tbg .seg > button .tbg-ic, .view.full:not(.tb-side) .tbg-b .tbg-ic { width: .85rem; height: .85rem; }
  .view.full:not(.tb-side) .tbg-b .dd-car { font-size: .65rem; }
  .view.full:not(.tb-side) .tbg-b > .tb3-zoom .btn.sm { width: 1.75rem; min-height: 1.75rem; }
  .view.full:not(.tb-side) .tbg-more { width: 1.6rem; height: 1.6rem; font-size: .85rem; border-width: 1px; }
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-h { min-height: 1.75rem; padding: .1rem .55rem .1rem .4rem; gap: .3rem; font-size: .76rem; }
  .view.full:not(.tb-side) .tbg.tbg-an:not(.open) .tbg-hic { width: .95rem; height: .95rem; }
  .view.full:not(.tb-side) .tbg.tbg-an .tbg-car { width: 1rem; height: 1rem; font-size: .85rem; }
}
@media (min-width: 900px) {   /* 2 nút "+" xếp chồng ở cột phải, nhóm Xem chiếm phần còn lại */
  .view.full:not(.tb-side) .tbg-wrap:not(:has(.tbg-an.open)) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .view.full:not(.tb-side) .tbg-wrap:not(:has(.tbg-an.open)) > .tbg-view { grid-row: span 2; }
  .view.full:not(.tb-side) .tbg-wrap:not(:has(.tbg-an.open)) > .tbg-an { justify-self: stretch; }
  .view.full:not(.tb-side) .tbg-wrap:not(:has(.tbg-an.open)) > .tbg-an .tbg-h { width: 100%; justify-content: flex-start; }
}

/* ===== 2.0.130: Tìm dòng họ (chép từ nền tảng 3.0.33 — dùng chung; phần .lp3 / trang giới thiệu không dùng ở bản Họ Mai) ===== */

/* ===================== 3.0.33: trang giới thiệu — thông điệp, online, popup gói, bài viết, Tìm dòng họ ===================== */
.gt-ic { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; flex: none; }
.gt-ic svg { width: 100%; height: 100%; }
/* thông điệp chú ý */
.gt-td-slot.top { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.gt-td-slot.hero { display: none; }
.gt-td { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: .55rem; max-width: 100%; padding: .42rem 1.1rem .42rem .5rem; border-radius: 999px;
  background: linear-gradient(100deg, #9b1218, #d42028 55%, #b3121a); color: #fff; font-weight: 700; font-size: .95rem; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(180, 20, 26, .35), 0 0 0 3px rgba(255, 211, 107, .45); animation: gtTdNhip 2.6s ease-in-out infinite; }
.gt-td-tx { overflow: hidden; text-overflow: ellipsis; }
.gt-td-so { display: inline-block; color: #ffd36b; font-size: 1.15em; padding: 0 .1em; animation: gtTdSo 2.6s ease-in-out infinite; }
.gt-td-ic { position: relative; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: #fff3d6; font-size: 1.05rem; }
.gt-td-ic i { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #ffd36b; animation: gtTdVong 1.8s ease-out infinite; }
.gt-td-sh { position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); animation: gtTdSang 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes gtTdNhip { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes gtTdSo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px) scale(1.08); } }
@keyframes gtTdVong { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes gtTdSang { 0% { left: -40%; } 60%, 100% { left: 130%; } }
@media (max-width: 1400px) { .gt-td-slot.top { display: none; } .gt-td-slot.hero { display: block; margin: 0 0 .9rem; } }
.gt-td.nho { font-size: .88rem; white-space: normal; }
/* số chạy n-2 → n-1 → n */
.lp3 .lp3-cnt.gt-roll { display: inline-block; animation: gtRoll .45s cubic-bezier(.2, .8, .3, 1.3) both; }
.lp3 .lp3-cnt.gt-xong { animation: gtRoll .45s cubic-bezier(.2, .8, .3, 1.3) both, gtPop .5s .45s ease both; }
@keyframes gtRoll { from { transform: translateY(70%); opacity: 0; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes gtPop { 50% { transform: scale(1.12); color: #d42028; } }
/* đang online + chăm sóc khách hàng */
.lp3 .gt-live { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; position: relative; z-index: 3; }
.gt-live-it { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: 16px; background: rgba(255, 255, 255, .9); border: 1px solid #f1dfbd;
  box-shadow: 0 6px 18px rgba(150, 90, 20, .1); color: #3a2a1e; text-decoration: none; min-width: 0; }
.gt-live-it > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.gt-live-it small { font-size: .75rem; color: #7a6450; font-weight: 600; }
.gt-live-it b { font-size: 1.05rem; color: #a3141a; }
.gt-live-ic { position: relative; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; color: #fff; background: #2e7d32; }
.gt-live-it.m .gt-live-ic { background: #e9862b; }
.gt-live-it.z .gt-live-ic { background: #0068ff; font-size: .72rem; } .gt-live-it.z .gt-live-ic b { color: #fff; font-size: .78rem; }
.gt-live-it.t .gt-live-ic { background: #d42028; animation: gtRung 2.4s ease-in-out infinite; }
a.gt-live-it:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(150, 90, 20, .18); }
.gt-dot { position: absolute; right: -3px; top: -3px; width: .7rem; height: .7rem; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.gt-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22c55e; animation: gtTdVong 1.6s ease-out infinite; }
@keyframes gtRung { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg); } 88% { transform: rotate(12deg); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(6deg); } }
@media (min-width: 1700px) {   /* màn hình rộng: cột nổi bên phải phần đầu trang (chỗ trống cạnh 2 điện thoại) */
  .lp3 .gt-live { position: absolute; top: 18%; right: calc(-1 * ((100vw - 1360px) / 2) + 1.2rem); width: 11.5rem; grid-template-columns: 1fr; gap: .7rem; }
}
@media (max-width: 760px) { .lp3 .gt-live { grid-template-columns: 1fr 1fr; } .gt-live-it { padding: .45rem .55rem; } .gt-live-ic { width: 2rem; height: 2rem; } .gt-live-it b { font-size: .95rem; } }
/* thẻ gói bấm được */
.lp3 .lp3-plan { cursor: pointer; transition: transform .2s, box-shadow .2s; }
.lp3 .lp3-plan:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(120, 60, 10, .16); }
.lp3 .lp3-plan:focus-visible { outline: 3px solid #e2a93b; outline-offset: 3px; }
.gt-plan-xem { display: flex; align-items: center; justify-content: center; gap: .35rem; margin: .2rem 1.2rem .5rem; font-size: .88rem; font-weight: 700; color: #a3141a; text-decoration: underline dotted; text-underline-offset: 3px; }
.gt-plan-xem i { font-style: normal; font-size: 1.2rem; transition: transform .2s; }
.lp3-plan:hover .gt-plan-xem i { transform: translateX(4px); }
/* popup gói */
.gt-goi-pop { max-width: 920px !important; }
.gt-goi { --g1: #c0161f; --g2: #8e0e14; }
.gt-g-hd { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: 18px; color: #fff; background: linear-gradient(100deg, var(--g2), var(--g1)); flex-wrap: wrap; }
.gt-g-ic { width: 3.6rem; height: 3.6rem; border-radius: 16px; background: #fff; display: grid; place-items: center; font-size: 2rem; flex: none; }
.gt-g-hd > div:nth-child(2) { flex: 1; min-width: 12rem; }
.gt-g-hd small { font-size: .75rem; letter-spacing: .12em; font-weight: 800; opacity: .85; }
.gt-g-hd h3 { margin: .1rem 0; font-family: 'Noto Serif', Georgia, serif; font-size: 1.7rem; color: #fff; }
.gt-g-hd p { margin: 0; opacity: .9; }
.gt-g-gia { text-align: right; display: flex; flex-direction: column; }
.gt-g-gia b { font-size: 2rem; line-height: 1.1; color: #ffe08a; }
.gt-g-gia small { opacity: .85; } .gt-g-gia em { font-style: normal; font-weight: 700; font-size: .9rem; margin-top: .2rem; }
.gt-g-so { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .9rem 0; }
.gt-g-so div { text-align: center; padding: .6rem; border-radius: 14px; background: #fff8ec; border: 1px solid #f0dcb6; }
.gt-g-so b { display: block; font-size: 1.4rem; color: var(--g2); } .gt-g-so small { color: #7a6450; }
.gt-g-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gt-g-2 h4, .gt-g-sh h4 { margin: .2rem 0 .4rem; color: #7a1a10; font-size: 1rem; }
.gt-g-ql { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.gt-g-ql li { position: relative; padding-left: 1.5rem; line-height: 1.45; }
.gt-g-ql li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--g1); font-weight: 900; }
.gt-g-ql.chung li::before { content: "◆"; color: #c9901a; font-size: .8rem; top: .15rem; }
.gt-g-share { display: flex; gap: 1rem; align-items: center; margin-top: 1.1rem; padding: .9rem; border-radius: 16px; background: #fff6e4; border: 1px dashed #e2b86a; }
.gt-g-qr { flex: none; width: 9.5rem; height: 9.5rem; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid #f0dcb6; }
.gt-g-qr img { width: 100%; height: 100%; } .gt-g-qr .skel { width: 80%; height: 80%; }
.gt-g-sh { flex: 1; min-width: 0; } .gt-g-sh p { margin: 0 0 .5rem; font-size: .9rem; color: #6b5540; }
.gt-g-link { display: flex; gap: .4rem; }
.gt-g-link input { flex: 1; min-width: 0; padding: .45rem .7rem; border-radius: 10px; border: 1px solid #e2c48a; font: inherit; font-size: .85rem; background: #fff; }
.gt-g-link button, .gt-g-btns button { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; border: 1.5px solid #e2c48a; background: #fff; color: #a3141a; font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; }
.gt-g-btns { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .55rem; }
.gt-g-btns button.z { background: #0068ff; border-color: #0068ff; color: #fff; } .gt-g-btns button.f { background: #1877f2; border-color: #1877f2; color: #fff; }
.gt-g-btns button b { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #fff; color: #0068ff; font-size: .75rem; }
.gt-g-btns button.f b { color: #1877f2; }
@media (max-width: 640px) { .gt-g-2 { grid-template-columns: 1fr; } .gt-g-share { flex-direction: column; align-items: stretch; } .gt-g-qr { align-self: center; } .gt-g-gia { text-align: left; } }
/* mục bài viết */
.gt-bai { max-width: 1240px; margin: 0 auto; padding: 3rem clamp(1rem, 3vw, 2rem) 3.5rem; }
.gt-bai-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.gt-eye { margin: 0; font-size: .82rem; font-weight: 800; letter-spacing: .16em; color: #c9901a; }
.gt-bai-hd h2 { margin: .2rem 0 0; font-family: 'Noto Serif', Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.4rem); color: #a3141a; }
.gt-bai-all { font-weight: 800; color: #a3141a; text-decoration: none; padding: .5rem 1.1rem; border-radius: 999px; border: 1.5px solid #e2b86a; background: #fff; }
.gt-bai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.gt-bai-c { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid #f0dfc4; text-decoration: none; color: inherit; box-shadow: 0 6px 18px rgba(120, 60, 10, .07); transition: transform .2s, box-shadow .2s; }
.gt-bai-c:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(120, 60, 10, .15); }
.gt-bai-c.lon { grid-row: span 2; }
.gt-bai-img { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #fff3dc, #f6e2bb); overflow: hidden; }
.gt-bai-c.lon .gt-bai-img { aspect-ratio: auto; flex: 1; min-height: 14rem; }
.gt-bai-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gt-bai-img.trang-tri img { object-fit: contain; padding: .8rem; }
.gt-bai-c:hover .gt-bai-img img { transform: scale(1.05); }
.gt-bai-tx { display: flex; flex-direction: column; gap: .3rem; padding: .85rem 1rem 1rem; }
.gt-bai-tx b { font-family: 'Noto Serif', Georgia, serif; font-size: 1.12rem; line-height: 1.35; color: #7e0d12; }
.gt-bai-tx small { color: #6b5540; font-size: .9rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gt-bai-tx em { font-style: normal; font-size: .8rem; color: #9a8470; }
.gt-bai-nb { align-self: flex-start; font-style: normal; font-size: .72rem; font-weight: 800; color: #fff; background: #d42028; padding: .1rem .55rem; border-radius: 999px; }
.gt-bai-trong { padding: 1rem; border-radius: 14px; background: #fff6e4; border: 1px dashed #e2b86a; color: #7a4a08; }
@media (max-width: 900px) { .gt-bai-grid { grid-template-columns: 1fr 1fr; } .gt-bai-c.lon { grid-row: auto; grid-column: 1 / -1; } }
@media (max-width: 560px) { .gt-bai-grid { grid-template-columns: 1fr; } }
/* nút nổi + ô Tìm dòng họ */
.gt-th { position: fixed; z-index: 23; right: 16px; bottom: 16px; }
.lp3.lp3-show .gt-th { display: none; }
.gt-th-pill { display: inline-flex; align-items: center; gap: .5rem; min-height: 3rem; padding: 0 1.15rem; border-radius: 999px; border: 2px solid #ffd36b; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1rem; color: #fff; background: linear-gradient(180deg, #c4161c, #8e0e14); box-shadow: 0 10px 24px rgba(140, 20, 20, .35); animation: gtTdNhip 3s ease-in-out infinite; }
.gt-th-pill .gt-ic { width: 1.3rem; height: 1.3rem; }
.gt-th-n { min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: #ffd36b; color: #7e0d12; font-size: .8rem; display: grid; place-items: center; }
.gt-th-mo, .gt-th-to { display: flex; flex-direction: column; width: min(27rem, calc(100vw - 2rem)); height: min(40rem, calc(100vh - 7rem)); border-radius: 18px; overflow: hidden;
  background: #fffaf0; border: 2px solid #e9b34f; box-shadow: 0 18px 44px rgba(110, 40, 5, .3), 0 0 0 4px rgba(233, 179, 79, .18); }
.gt-th-to { right: 50% !important; bottom: 50%; transform: translate(50%, 50%); width: min(68rem, calc(100vw - 2rem)); height: calc(100vh - 3rem); z-index: 60; }
.gt-th-hd { display: flex; align-items: center; gap: .6rem; padding: .65rem .7rem .65rem .8rem; color: #fff; background: linear-gradient(100deg, #8e0e14, #c0161f); }
.gt-th-hd > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.gt-th-hd small { opacity: .85; font-size: .78rem; }
.gt-th-hic { width: 2.2rem; height: 2.2rem; border-radius: 12px; display: grid; place-items: center; background: #fff; color: #b3121a; }
.gt-th-b { width: 2.1rem; height: 2.1rem; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; display: grid; place-items: center; }
.gt-th-b:hover { background: rgba(255, 255, 255, .3); }
.gt-th-tools { display: flex; gap: .45rem; padding: .6rem .7rem; border-bottom: 1px solid #f0dfc4; background: #fff6e8; }
.gt-th-q { flex: 1; display: flex; align-items: center; gap: .4rem; padding: 0 .6rem; border-radius: 999px; background: #fff; border: 1.5px solid #e2c48a; color: #a3141a; }
.gt-th-q input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; padding: .45rem 0; }
.gt-th-viet { display: inline-flex; align-items: center; gap: .35rem; border: 0; border-radius: 999px; padding: 0 .9rem; font: inherit; font-weight: 800; color: #fff; background: #2e7d32; cursor: pointer; white-space: nowrap; }
.gt-th-list { flex: 1; overflow-y: auto; padding: .6rem; display: flex; flex-direction: column; gap: .55rem; }
.gt-th-to .gt-th-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); align-content: start; }
.gt-th-list .skel { height: 6rem; border-radius: 14px; }
.gt-th-it { display: flex; gap: .7rem; text-align: left; padding: .65rem; border-radius: 14px; border: 1px solid #f0dfc4; background: #fff; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .2s, transform .2s; }
.gt-th-it:hover { box-shadow: 0 8px 20px rgba(120, 60, 10, .14); transform: translateY(-2px); }
.gt-th-it.nb { border-color: #e9b34f; box-shadow: 0 0 0 2px rgba(233, 179, 79, .25); }
.gt-th-it > img, .gt-th-ph { flex: none; width: 4.6rem; height: 4.6rem; border-radius: 12px; object-fit: cover; }
.gt-th-ph { display: grid; place-items: center; font-family: 'Noto Serif', Georgia, serif; font-size: 2rem; font-weight: 700; color: #fff; background: radial-gradient(circle at 30% 30%, #d42028, #7e0d12); border: 3px solid #f2c14e; }
.gt-th-it-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.gt-th-it-tx > b { font-family: 'Noto Serif', Georgia, serif; color: #7e0d12; line-height: 1.3; }
.gt-th-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.gt-th-chips i { font-style: normal; font-size: .74rem; font-weight: 700; padding: .08rem .5rem; border-radius: 999px; background: #f6efe2; color: #5a3a1a; }
.gt-th-chips i.ho { background: #b3121a; color: #fff; } .gt-th-chips i.kh { background: #fde9b8; color: #7a4a08; border: 1px solid #f0c96a; }
.gt-th-chips i.nam { background: #1f4a7a; color: #fff; font-family: 'Noto Serif', Georgia, serif; }
.gt-th-cc { font-style: italic; color: #6b5540; line-height: 1.4; }
.gt-th-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.gt-th-tags em { font-style: normal; font-size: .76rem; font-weight: 800; color: #b3121a; }
.gt-th-tags.lon em { font-size: .9rem; padding: .15rem .7rem; border-radius: 999px; background: #fde9b8; border: 1px solid #f0c96a; color: #7a4a08; }
.gt-th mark, .gt-thd mark { background: #ffe066; color: inherit; padding: 0 .1em; border-radius: 3px; }
.gt-th-trong { padding: 1rem; border-radius: 14px; background: #fff6e4; border: 1px dashed #e2b86a; color: #5a3a1a; } .gt-th-trong p { margin: .4rem 0 0; font-size: .9rem; }
.gt-th-ft { display: flex; justify-content: space-between; align-items: center; padding: .45rem .8rem; font-size: .82rem; color: #7a6450; border-top: 1px solid #f0dfc4; background: #fff6e8; }
.gt-th-ft a { color: #a3141a; font-weight: 700; }
@media (max-width: 599px) { .gt-th { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); } .gt-th-pill { min-height: 2.6rem; padding: 0 .9rem; font-size: .92rem; }
  .gt-th-mo, .gt-th-to { right: 8px !important; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 5rem); transform: none; } .gt-th-to .gt-th-list { grid-template-columns: 1fr; } }
/* cửa sổ chi tiết Tìm dòng họ */
.gt-thd-pop { max-width: 880px !important; }
.gt-thd-t { margin: 0; font-family: 'Noto Serif', Georgia, serif; color: #7e0d12; font-size: 1.5rem; line-height: 1.3; }
.gt-thd-meta { color: #7a6450; font-size: .85rem; margin: .3rem 0 .8rem; }
.gt-thd-anh { display: flex; gap: .5rem; overflow-x: auto; margin-bottom: .8rem; }
.gt-thd-anh img { height: 11rem; border-radius: 12px; object-fit: cover; }
.gt-thd-hl { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .5rem; margin-bottom: .7rem; }
.gt-thd-hl div { padding: .55rem .75rem; border-radius: 12px; background: #fff; border: 1.5px solid #ecd3a3; display: flex; flex-direction: column; }
.gt-thd-hl small { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #b3121a; }
.gt-thd-hl b { color: #3a2a1e; }
.gt-thd-lead { font-weight: 600; color: #5a2a12; background: #fff3dc; border-left: 4px solid #e2a93b; padding: .55rem .85rem; border-radius: 0 10px 10px 0; }
.gt-thd-sec { margin-top: .9rem; }
.gt-thd-sec h3 { display: flex; align-items: center; gap: .45rem; margin: 0 0 .3rem; font-size: 1.08rem; color: #7e0d12; }
.gt-thd-sec h3 i { font-style: normal; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: #b3121a; color: #fff; font-size: .85rem; }
.gt-thd-p p { margin: .3rem 0; line-height: 1.6; white-space: pre-wrap; }
.gt-thd-moc { list-style: none; margin: .2rem 0; padding: 0 0 0 .9rem; border-left: 3px solid #e2a93b; }
.gt-thd-moc li { margin: .3rem 0; } .gt-thd-moc b { display: inline-block; min-width: 5rem; color: #1f4a7a; font-family: 'Noto Serif', Georgia, serif; }
.gt-thd-cc { padding: .3rem .9rem; border-radius: 12px; background: #fff8e6; border: 1px dashed #e2b86a; font-style: italic; }
.gt-thd-ket { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; padding: .8rem 1rem; border-radius: 14px; color: #fff; background: linear-gradient(100deg, #8e0e14, #c0161f); }
.gt-thd-ket div { display: flex; flex-direction: column; } .gt-thd-ket small { opacity: .85; }
.gt-thd-ket button { border: 0; border-radius: 999px; padding: .5rem 1rem; font: inherit; font-weight: 800; background: #ffd36b; color: #5a1a0a; cursor: pointer; }
/* form gửi bài Tìm dòng họ */
.gt-form-pop { max-width: 820px !important; }
.gt-form { display: flex; flex-direction: column; gap: .7rem; }
.gt-form-gt { margin: 0; padding: .6rem .8rem; border-radius: 12px; background: #fff6e4; border: 1px dashed #e2b86a; font-size: .92rem; }
.gt-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.gt-f { display: flex; flex-direction: column; gap: .25rem; }
.gt-f > span { font-weight: 700; font-size: .9rem; color: #5a2a12; }
.gt-f input, .gt-f textarea { font: inherit; padding: .55rem .7rem; border-radius: 10px; border: 1.5px solid #e2c48a; background: #fff; width: 100%; box-sizing: border-box; }
.gt-f small { color: #7a6450; font-size: .8rem; }
.gt-moc { display: flex; flex-direction: column; gap: .4rem; }
.gt-moc-r { display: grid; grid-template-columns: 11rem 1fr 2.2rem; gap: .4rem; }
.gt-moc-r input { font: inherit; padding: .5rem .65rem; border-radius: 10px; border: 1.5px solid #e2c48a; min-width: 0; }
.gt-moc-r button, .gt-ma-lai { border: 1.5px solid #e2c48a; background: #fff; border-radius: 10px; cursor: pointer; color: #a3141a; font-weight: 700; }
.gt-moc-them { align-self: flex-start; margin-top: .4rem; border: 1.5px dashed #c9901a; background: #fffaf0; color: #7a4a08; padding: .35rem .9rem; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; }
.gt-ma { display: flex; align-items: flex-end; gap: .5rem; flex-wrap: wrap; } .gt-ma .gt-f { flex: 1; min-width: 12rem; }
.gt-ma-img { height: 2.9rem; border-radius: 10px; border: 1px solid #e2c48a; } .gt-ma-lai { height: 2.9rem; width: 2.9rem; font-size: 1.2rem; }
.gt-bay { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gt-form-me { margin: 0; color: #2e7d32; }
.gt-ok { text-align: center; padding: .5rem 0; } .gt-ok b { font-size: 1.3rem; color: #2e7d32; }
@media (max-width: 640px) { .gt-f2 { grid-template-columns: 1fr; } .gt-moc-r { grid-template-columns: 6.5rem 1fr 2.2rem; } }
@media (prefers-reduced-motion: reduce) { .gt-td, .gt-td-so, .gt-td-ic i, .gt-td-sh, .gt-th-pill, .gt-live-it.t .gt-live-ic, .gt-dot::after { animation: none !important; } }
.gt-td-slot.top { overflow: hidden; }
.gt-td-slot.top .gt-td { flex: none; }
.gt-td-slot.top.chat { display: none; }
.gt-td-slot.hero.can { display: block; margin: 0 0 .9rem; }
@media (max-width: 760px) { .gt-td-slot.hero { padding-right: 3.4rem; } }
/* 3.0.33: Quản trị nền tảng › Trang giới thiệu */
.gtq-sub, .gtq-loc { display: flex; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 .8rem; }
.gtq-sub button, .gtq-loc button { font: inherit; font-weight: 700; padding: .45rem 1rem; border-radius: 999px; border: 1.5px solid var(--line, #e2c48a); background: var(--surface, #fff); color: inherit; cursor: pointer; }
.gtq-sub button.on, .gtq-loc button.on { background: var(--brand, #a3141a); border-color: var(--brand, #a3141a); color: #fff; }
.gtq-loc button { font-size: .85rem; padding: .3rem .8rem; }
.gtq-g4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem 1rem; }
.gtq-th { width: 3.6rem; height: 3.6rem; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: #f6efe2; font-weight: 800; font-size: 1.3rem; color: #a3141a; }
.gtq-tbl td { vertical-align: top; }
.gtq-tbl tr.gtq-cho td { background: #fff8e1; }
.gtq-nb { margin-left: .4rem; font-size: .72rem; font-weight: 800; color: #fff; background: #d42028; padding: .05rem .45rem; border-radius: 999px; }
.gtq-tt { display: inline-block; font-size: .78rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.gtq-tt.cho { background: #fde9b8; color: #7a4a08; } .gtq-tt.dang { background: #dcf3dc; color: #1f6b3a; } .gtq-tt.an { background: #eee; color: #555; } .gtq-tt.tc { background: #fde2e2; color: #a3141a; }
.gtq-pop { max-width: 980px !important; }
.gtq-soan { display: flex; flex-direction: column; gap: .5rem; }
.gtq-soan textarea { width: 100%; box-sizing: border-box; }
.gtq-ck { display: flex; flex-direction: column; gap: .3rem; justify-content: center; }
.gt-td-slot.top { padding: 0 .4rem; }
.gt-td-slot.top .gt-td { flex: 0 1 auto; white-space: normal; font-size: .86rem; line-height: 1.2; padding: .32rem .95rem .32rem .4rem; border-radius: 18px; max-width: 30rem; }
.gt-td-slot.top .gt-td-tx { overflow: visible; }
.gt-td-slot.top { flex: 1 1 0; }
.gt-td-slot.top .gt-td { white-space: nowrap; width: auto; }
.gt-td-in { display: inline-block; }
.gt-td.chay .gt-td-tx { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.gt-td.chay .gt-td-in { animation: gtTdChay var(--t, 8s) ease-in-out infinite alternate; padding: 0 .5rem; }
@keyframes gtTdChay { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(var(--d, 0)); } }
@media (prefers-reduced-motion: reduce) { .gt-td.chay .gt-td-in { animation: none; } }
.gt-td-slot.top .gt-td { min-width: 0; max-width: min(100%, 30rem); }
.gt-td-slot.top .gt-td-tx { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.gt-td-slot.top { padding: 6px .6rem; align-self: stretch; align-items: center; }
/* 2.0.130 / 3.0.33: nút "Tìm dòng họ" ở Trang chủ trong ứng dụng (cạnh "Theo dòng thời gian") */
.gt-th.app { z-index: 21; }
.gt-ket p { margin: 0 0 .6rem; }
.gt-g-btns a.btn { text-decoration: none; }
@media (max-width: 599px) {
  .gt-th.app.gt-th-an { right: auto; left: 10px; bottom: calc(var(--bnav-h, 4.4rem) + 10px + env(safe-area-inset-bottom)); }
  .gt-th.app.gt-th-mo, .gt-th.app.gt-th-to { bottom: calc(var(--bnav-h, 4.4rem) + 8px); height: calc(100vh - var(--bnav-h, 4.4rem) - 5rem); z-index: 60; }
}
@media print { .gt-th { display: none !important; } }
/* 2.0.131 / 3.0.36: Tìm dòng họ — điểm lưu ý quan trọng (tối đa 10) */
.gt-dn-wrap > small { color: #7a6450; font-size: .8rem; margin-bottom: .2rem; }
.gt-dn { display: flex; flex-direction: column; gap: .4rem; counter-reset: dn; }
.gt-dn-r { display: grid; grid-template-columns: 1.8rem 1fr 2.2rem; gap: .4rem; align-items: center; }
.gt-dn-r b { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: #d42028; color: #fff; font-size: .82rem; }
.gt-dn-r input { font: inherit; padding: .5rem .65rem; border-radius: 10px; border: 1.5px solid #f0c96a; background: #fffaf0; min-width: 0; }
.gt-dn-r button { height: 100%; border: 1.5px solid #e2c48a; background: #fff; border-radius: 10px; cursor: pointer; color: #a3141a; font-weight: 700; }
.gt-th-dn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.gt-th-dn li { position: relative; padding-left: 1.1rem; font-size: .84rem; font-weight: 600; color: #5a2a12; line-height: 1.35; }
.gt-th-dn li::before { content: "◆"; position: absolute; left: 0; top: .05rem; color: #d42028; font-size: .7rem; }
.gt-th-dn li.them { color: #a3141a; font-weight: 800; } .gt-th-dn li.them::before { content: ""; }
.gt-thd-dn { margin: .2rem 0; padding: 0; list-style: none; counter-reset: dn; display: grid; gap: .4rem; }
.gt-thd-dn li { counter-increment: dn; position: relative; padding: .5rem .8rem .5rem 2.7rem; border-radius: 12px; background: #fff3dc; border: 1.5px solid #f0c96a; font-weight: 600; line-height: 1.45; }
.gt-thd-dn li::before { content: counter(dn); position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); width: 1.55rem; height: 1.55rem; border-radius: 50%; background: #d42028; color: #fff; display: grid; place-items: center; font-size: .8rem; }
/* 2.0.132: nhãn bài minh hoạ (Tìm dòng họ — dùng chung) */
.gt-th-chips i.mh, .gt-thd-mh { background: #ececec; color: #555; border: 1px dashed #bbb; }
.gt-thd-mh { display: inline-block; font-size: .75rem; font-weight: 800; padding: 0 .55rem; border-radius: 999px; margin-right: .4rem; }
/* 2.0.134 / 3.0.41: đánh số thứ tự bài trong ô Tìm dòng họ */
.gt-th-it { position: relative; }
.gt-th-so { position: absolute; top: -8px; left: -8px; z-index: 2; min-width: 1.7rem; height: 1.7rem; padding: 0 .3rem; border-radius: 999px; display: grid; place-items: center;
  font-size: .82rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, #d42028, #a3141a); border: 2px solid #ffd36b; box-shadow: 0 3px 8px rgba(160, 20, 26, .35); }
.gt-th-so.w2 { font-size: .78rem; } .gt-th-so.w3 { font-size: .7rem; }
.gt-th-list { padding-top: .9rem; padding-left: .9rem; }
/* 2.0.135 / 3.0.42: điểm nhấn hot trong ô Tìm dòng họ */
.gt-th-hot { display: flex; gap: .3rem; align-items: center; overflow-x: auto; padding: .45rem .7rem; border-bottom: 1px solid #f0dfc4; background: #fffaf0; scrollbar-width: thin; }
.gt-th-hot b { flex: none; }
.gt-th-hot button { flex: none; font: inherit; font-size: .78rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; border: 1px solid #f0c96a; background: #fff3dc; color: #7a3a08; cursor: pointer; white-space: nowrap; }
.gt-th-hot button.on, .gt-th-hot button:hover { background: #d42028; border-color: #d42028; color: #fff; }
.gt-th-to .gt-th-hot { flex-wrap: wrap; }

/* 2.0.138 (dùng chung 3.0.49): Tên miền cho gia phả */
.tm-gt h3 { margin: 0 0 .3rem; }
.tm-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .6rem; }
.tm-2 > div { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; padding: .8rem .9rem; border-radius: 14px; border: 1.5px solid var(--line, #ecd3a3); background: var(--surface, #fff); }
.tm-2 small { color: var(--muted, #6b5540); line-height: 1.45; }
.tm-cho { background: #fff8e1; border-color: #f0c96a; }
.tm-ds { display: flex; flex-direction: column; gap: .6rem; }
.tm-it { padding: .75rem .9rem; border-radius: 14px; border: 1.5px solid var(--line, #ecd3a3); background: var(--surface, #fff); border-left-width: 5px; }
.tm-it.ok { border-left-color: #2e8b4e; } .tm-it.cho { border-left-color: #c9901a; } .tm-it.duyet { border-left-color: #2a6fd5; } .tm-it.ng { border-left-color: #999; opacity: .85; }
.tm-it-hd { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tm-url { font-weight: 800; font-size: 1.05rem; word-break: break-all; }
.tm-loai { font-size: .72rem; font-weight: 800; padding: .1rem .55rem; border-radius: 999px; background: #e3f4dc; color: #1f6b3a; } .tm-loai.rieng { background: #ece2fb; color: #5a32a8; }
.tm-tt { margin-left: auto; font-size: .76rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px; background: #eee; color: #555; }
.tm-tt.ok { background: #dcf3dc; color: #1f6b3a; } .tm-tt.cho { background: #fde9b8; color: #7a4a08; } .tm-tt.duyet { background: #def0fd; color: #1f4a7a; }
.tm-it-meta { font-size: .82rem; color: var(--muted, #6b5540); margin-top: .25rem; }
.tm-kq { margin-top: .35rem; font-size: .82rem; padding: .35rem .6rem; border-radius: 8px; background: #f7f3ea; }
.tm-hd { margin-top: .55rem; padding: .6rem .7rem; border-radius: 10px; background: #fffaf0; border: 1px dashed #e2b86a; font-size: .88rem; }
.tm-dns { width: 100%; border-collapse: collapse; margin: .4rem 0; font-size: .85rem; }
.tm-dns th, .tm-dns td { text-align: left; padding: .3rem .45rem; border-bottom: 1px solid #f0dfc4; word-break: break-all; }
.tm-dns code, .tm-may code, .tm-2 code { font-size: .82rem; background: #f3eadb; padding: 0 .3rem; border-radius: 4px; }
.tm-cp { border: 0; background: none; cursor: pointer; color: var(--brand, #a3141a); font-size: 1rem; padding: 0 .25rem; }
.tm-acts { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .55rem; }
.tm-luu { display: block; color: #a3420a; font-size: .82rem; margin-top: .35rem; }
.tm-form { display: flex; flex-direction: column; gap: .5rem; }
.tm-sub { display: flex; align-items: center; gap: .3rem; } .tm-sub input { flex: 1; min-width: 0; } .tm-sub span { color: var(--muted, #6b5540); white-space: nowrap; }
.tm-xem { font-size: .9rem; padding: .45rem .7rem; border-radius: 10px; background: #f3faf0; color: #1f6b3a; word-break: break-all; }
.tm-may summary { cursor: pointer; font-weight: 800; } .tm-may li { margin: .35rem 0; line-height: 1.5; }
@media (max-width: 640px) { .tm-2 { grid-template-columns: 1fr; } }

/* 3.0.52 / 2.0.140: thẻ Tìm lại cội nguồn nổi bật trong trang Tính năng */
.tg-feat-timho { position: relative; border-color: #e0a526; background: linear-gradient(160deg, #fffaf0, #fff3d6); box-shadow: 0 0 0 2px rgba(224,165,38,.25), 0 6px 22px rgba(224,165,38,.35); animation: tgHq 2.6s ease-in-out infinite; }
.tg-feat-timho .tg-fic { color: #b45309; }
.tg-hot { position: absolute; top: .6rem; right: .7rem; font-size: .78rem; font-weight: 700; color: #fff; background: linear-gradient(90deg, #c8261f, #e0a526); padding: .15rem .55rem; border-radius: 999px; }
@keyframes tgHq { 0%,100% { box-shadow: 0 0 0 2px rgba(224,165,38,.25), 0 6px 22px rgba(224,165,38,.3); } 50% { box-shadow: 0 0 0 3px rgba(224,165,38,.55), 0 8px 30px rgba(224,165,38,.6); } }
@media (prefers-reduced-motion: reduce) { .tg-feat-timho { animation: none; } }

/* 3.0.53 / 2.0.141: bộ chọn gia phả trong "Gắn tên miền" — lọc dòng họ / miền / vùng / tỉnh / tên */
.tmc-lb { font-weight: 600; margin-bottom: .3rem; } .tmc-lb small { font-weight: 400; color: var(--muted, #6b5540); }
.tmc { position: relative; }
.tmc-btn { width: 100%; display: flex; align-items: center; gap: .6rem; text-align: left; padding: .55rem .8rem; border: 1.5px solid #e2c48d; border-radius: 12px; background: #fffdf8; cursor: pointer; font: inherit; color: inherit; }
.tmc-btn:hover, .tmc-btn[aria-expanded="true"] { border-color: #b45309; box-shadow: 0 0 0 3px rgba(180,83,9,.12); }
.tmc-ic { font-size: 1.25rem; flex: none; }
.tmc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .tmc-tx b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmc-tx small { color: var(--muted, #6b5540); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmc-dd { color: #b45309; font-size: 1.1rem; }
.tmc-pan { margin-top: .45rem; padding: .7rem; border: 1px solid #ecd9b4; border-radius: 14px; background: #fff; box-shadow: 0 8px 26px rgba(80,40,10,.12); display: flex; flex-direction: column; gap: .55rem; }
.tmc-q { width: 100%; }
.tmc-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.tmc-f label { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; color: var(--muted, #6b5540); } .tmc-f select { font-size: .88rem; padding: .35rem .45rem; }
.tmc-mrow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .tmc-mrow > span { font-size: .78rem; color: var(--muted, #6b5540); }
.tmc-mien { display: flex; gap: .3rem; flex-wrap: wrap; }
.tmc-mien button { border: 1px solid #e2c48d; background: #fffaf0; border-radius: 999px; padding: .2rem .65rem; font: inherit; font-size: .85rem; cursor: pointer; color: #5a3a20; }
.tmc-mien button small { margin-left: .3rem; font-size: .72rem; background: #f3e3c3; border-radius: 999px; padding: 0 .35rem; }
.tmc-mien button.on { background: #a3141a; border-color: #a3141a; color: #fff; } .tmc-mien button.on small { background: rgba(255,255,255,.25); }
.tmc-dem { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted, #6b5540); border-bottom: 1px dashed #ecd9b4; padding-bottom: .35rem; }
.tmc-xoa { border: 0; background: none; color: #a3141a; cursor: pointer; font: inherit; font-size: .82rem; }
.tmc-ds { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: .15rem; }
.tmc-h { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; background: #fbf1dc; color: #7a2e0e; font-weight: 700; font-size: .85rem; padding: .3rem .55rem; border-radius: 8px; }
.tmc-h small { font-weight: 400; color: #8a6a48; }
.tmc-it { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: .4rem .55rem; cursor: pointer; font: inherit; color: inherit; }
.tmc-it.nh { padding-left: 1.6rem; }
.tmc-it:hover, .tmc-it:focus-visible { background: #fff6e4; border-color: #f0dcb0; outline: none; }
.tmc-it.on { background: #fdeee0; border-color: #e0a526; }
.tmc-it mark { background: #ffe58a; color: inherit; border-radius: 3px; }
.tmc-co { flex: none; font-size: .72rem; color: #1f6b3a; background: #e8f6ec; border-radius: 999px; padding: .1rem .5rem; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmc-ok { color: #1f6b3a; font-weight: 700; }
.tmc-rong { margin: .6rem; color: var(--muted, #6b5540); text-align: center; }
@media (max-width: 560px) { .tmc-f { grid-template-columns: 1fr 1fr; } .tmc-f label:first-child { grid-column: 1 / -1; } .tmc-ds { max-height: 46vh; } }

/* 3.0.54 / 2.0.142: mục công khai trên tên miền */
.ck-form { display: flex; flex-direction: column; gap: .6rem; } .ck-form > p { margin: 0; line-height: 1.5; }
.ck-nhanh { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted, #6b5540); }
.ck-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .45rem; }
.ck-row { display: flex; align-items: flex-start; gap: .55rem; padding: .55rem .7rem; border: 1.5px solid #ecd9b4; border-radius: 12px; background: #fffdf8; cursor: pointer; }
.ck-row input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: #1f6b3a; flex: none; }
.ck-row.on { border-color: #7cc08e; background: #f1faf3; } .ck-row.khoa { cursor: default; opacity: .9; }
.ck-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ck-tx small { color: var(--muted, #6b5540); font-size: .78rem; line-height: 1.35; }
.ck-tt { flex: none; font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: #f3e3c3; color: #7a2e0e; white-space: nowrap; }
.ck-row.on .ck-tt { background: #dff3e4; color: #1f6b3a; }
.ck-khoa { display: flex; justify-content: center; padding: 2rem 1rem; }
.ck-khoa-box { max-width: 34rem; text-align: center; background: #fffdf8; border: 1.5px solid #ecd9b4; border-radius: 20px; padding: 1.6rem 1.4rem; box-shadow: 0 8px 26px rgba(80,40,10,.1); }
.ck-khoa-ic { font-size: 2.6rem; } .ck-khoa-box h2 { margin: .3rem 0 .5rem; color: #a3141a; } .ck-khoa-box p { color: #5a3a20; line-height: 1.55; }
.ck-khoa-btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .8rem 0; }
.ck-khoa-mo { border-top: 1px dashed #ecd9b4; padding-top: .7rem; } .ck-khoa-mo small { color: var(--muted, #6b5540); }
.ck-khoa-mo div { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: .4rem; }
.ck-khoa-mo a { padding: .25rem .7rem; border-radius: 999px; background: #fbf1dc; color: #7a2e0e; text-decoration: none; font-size: .88rem; }

/* 3.0.55 / 2.0.143: khách chưa đăng nhập — công cụ thiết kế / tải về hiện nhưng khoá */
.gst-lock { position: relative; opacity: .55; filter: grayscale(.55); cursor: not-allowed !important; }
.gst-lock *, .gst-lock select { cursor: not-allowed !important; }
.gst-lock::after { content: '🔒'; position: absolute; top: -.45rem; right: -.35rem; font-size: .62rem; line-height: 1; background: #fff; border: 1px solid #e2c48d; border-radius: 999px; padding: .12rem .18rem; filter: none; opacity: 1; pointer-events: none; }
/* bản phả đồ mặc định */
.ban-md { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; padding: .55rem .75rem; border: 1.5px solid #f0d58a; border-radius: 12px; background: linear-gradient(160deg, #fffaf0, #fff3d6); }
.ban-md-ic { font-size: 1.35rem; color: #d99a06; flex: none; }
.ban-md-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ban-md-tx small { color: var(--muted, #6b5540); font-size: .8rem; line-height: 1.4; }
.ban-md-tag { flex: none; font-size: .78rem; font-weight: 700; color: #8a5a00; background: #fde68a; border-radius: 999px; padding: .2rem .55rem; white-space: nowrap; }

/* 3.0.57 / 2.0.145: Trang chủ tên miền gia phả — khung xem phả đồ mặc định */
.nh-gp { margin: 0 0 1rem; border: 1.5px solid #e9c98a; border-radius: 20px; background: linear-gradient(170deg, #fffaf0, #fdf0d6); box-shadow: 0 8px 26px rgba(120,60,10,.12); overflow: hidden; }
.nh-hd { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .7rem 1rem; border-bottom: 1px solid #f0dcb0; background: linear-gradient(90deg, #a3141a, #c8261f); color: #fff; }
.nh-tt { display: flex; align-items: center; gap: .6rem; min-width: 0; } .nh-ic { font-size: 1.6rem; }
.nh-tt b { display: block; font-family: var(--serif, Georgia, serif); font-size: 1.25rem; color: #ffe9a8; }
.nh-tt small { display: block; font-size: .8rem; color: #ffe; opacity: .9; }
.nh-btns { display: flex; gap: .35rem; flex-wrap: wrap; }
.nh-hd .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.55); }
.nh-hd .btn:not(.ghost) { background: #ffd463; color: #7a1a0a; border-color: #ffd463; }
.nh-khung { position: relative; height: clamp(22rem, 62vh, 44rem); background: #fff8ea; }
.nh-if { display: block; width: 100%; height: 100%; border: 0; }
.nh-gp:fullscreen { border-radius: 0; display: flex; flex-direction: column; } .nh-gp:fullscreen .nh-khung { flex: 1; height: auto; }
@media (max-width: 640px) { .nh-khung { height: 70vh; } .nh-tt small { display: none; } }
/* bên trong khung nhúng: chỉ còn phả đồ */
html.gp-nhung .topbar, html.gp-nhung .nav, html.gp-nhung .nav-grip, html.gp-nhung .bnav, html.gp-nhung .site-foot, html.gp-nhung .kp-pill, html.gp-nhung .tbg-design, html.gp-nhung .tbg-pub { display: none !important; }
html.gp-nhung .shell { --top-h: 0px; --nav-w: 0px; --bnav-h: 0px; }
html.gp-nhung .main { margin: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
html.gp-nhung .zl-fab, html.gp-nhung #zaloFab, html.gp-nhung .th-fab, html.gp-nhung .kp-box { display: none !important; }
