/* 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;
}
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; } }
