/* TNC Quản Lý Chương – Tu học: pháp danh + cấp đọc sách (px vì trang chương có cỡ chữ gốc nhỏ) */
.tth-chip,.tth-modal,.tth-toast{--th-sf:#FFFFFF;--th-sf2:#F4EFE6;--th-t1:#2C241E;--th-t2:#685B50;--th-t3:#938578;--th-bd:#E8E0D5;--th-ac:#8B5A2B;--th-ac2:#70461E;--th-acs:rgba(139,90,43,.1);--th-ok:#4A6B5D;font-family:'Be Vietnam Pro',system-ui,sans-serif}
[data-theme="sepia"] .tth-chip,[data-theme="sepia"] .tth-modal,[data-theme="sepia"] .tth-toast{--th-sf:#FAF3E6;--th-sf2:#EAE0CC;--th-t1:#3B2F23;--th-t2:#6B5846;--th-t3:#8C7762;--th-bd:#DFD1B8;--th-ac:#7D4E24;--th-ac2:#5E3918}
[data-theme="dark"] .tth-chip,[data-theme="dark"] .tth-modal,[data-theme="dark"] .tth-toast,.dark-theme .tth-chip,.dark-theme .tth-modal,.dark-theme .tth-toast{--th-sf:#262220;--th-sf2:#302B28;--th-t1:#EDE8E1;--th-t2:#B8AEA4;--th-t3:#887E75;--th-bd:#3A3430;--th-ac:#D49B58;--th-ac2:#E2B378;--th-acs:rgba(212,155,88,.15);--th-ok:#94C0AE}
.tth-chip *,.tth-modal *{box-sizing:border-box}

/* Nút pháp danh trên đầu web */
.tth-chip{display:inline-flex;align-items:center;gap:8px;height:40px;max-width:210px;padding:3px 12px 3px 3px;margin-right:8px;border:1px solid var(--th-bd);border-radius:999px;background:var(--th-sf);color:var(--th-t1);cursor:pointer;line-height:1.2;text-align:left;flex-shrink:0;transition:border-color .2s,box-shadow .2s}
.tth-chip:hover{border-color:var(--th-ac);box-shadow:0 4px 14px -4px rgba(44,36,30,.18)}
.tth-chip img{width:32px;height:32px;border-radius:50%;object-fit:cover;flex-shrink:0;background:var(--th-sf2)}
.tth-chip-t{display:flex;flex-direction:column;min-width:0}
.tth-chip-t b{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tth-chip-t small{font-size:11px;color:var(--th-ac);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tth-chip.bump{animation:tthBump .6s ease}
@keyframes tthBump{0%,100%{transform:scale(1)}40%{transform:scale(1.08)}}
@media (max-width:900px){.tth-chip{padding:3px;max-width:none;margin-right:6px}.tth-chip-t{display:none}.tth-chip{position:relative}.tth-chip::after{content:attr(data-cap);position:absolute;right:-4px;bottom:-4px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--th-ac);color:#fff;font-size:10px;font-weight:700;line-height:18px;text-align:center;border:2px solid var(--th-sf)}}

/* Hộp hồ sơ */
.tth-bd{position:fixed;inset:0;z-index:100010;background:rgba(20,16,12,.5);display:flex;align-items:center;justify-content:center;padding:16px}
.tth-bd[hidden]{display:none}
.tth-modal{position:relative;width:min(460px,100%);max-height:90vh;overflow-y:auto;background:var(--th-sf);color:var(--th-t1);border:1px solid var(--th-bd);border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.3);font-size:14px;line-height:1.5;text-align:left;overscroll-behavior:contain}
.tth-x{position:absolute;top:10px;right:10px;width:34px;height:34px;border:0;border-radius:50%;background:var(--th-sf2);color:var(--th-t2);font-size:22px;line-height:1;cursor:pointer;padding:0;z-index:2}
.tth-top{display:flex;gap:14px;align-items:center;padding:22px 22px 16px;background:linear-gradient(160deg,var(--th-acs),transparent 70%)}
.tth-top img{width:76px;height:76px;border-radius:50%;object-fit:cover;border:3px solid var(--th-sf);box-shadow:0 4px 14px rgba(44,36,30,.18);flex-shrink:0;background:var(--th-sf2)}
.tth-kick{display:block;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--th-ac)}
.tth-name{font-family:'Noto Serif',Georgia,serif;font-size:22px;font-weight:700;line-height:1.25;margin:2px 0 4px;color:var(--th-t1)}
.tth-capb{display:inline-block;padding:2px 10px;border-radius:999px;background:var(--th-ac);color:#FFFDF9;font-size:12px;font-weight:600}
.tth-sec{padding:0 22px 16px}
.tth-prog{display:flex;justify-content:space-between;font-size:12.5px;color:var(--th-t2);margin-bottom:6px}
.tth-prog b{color:var(--th-t1)}
.tth-bar{height:8px;border-radius:8px;background:var(--th-sf2);overflow:hidden}
.tth-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--th-ac),#C9945B);border-radius:8px;transition:width .4s}
.tth-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}
.tth-stats div{background:var(--th-sf2);border-radius:10px;padding:8px 6px;text-align:center}
.tth-stats b{display:block;font-size:18px;color:var(--th-t1)}
.tth-stats small{font-size:11.5px;color:var(--th-t2)}
.tth-h{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--th-t3);margin:4px 0 8px}
.tth-row{display:flex;flex-wrap:wrap;gap:8px}
.tth-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 14px;border:1px solid var(--th-bd);border-radius:999px;background:var(--th-sf);color:var(--th-t1);font:600 13px 'Be Vietnam Pro',system-ui,sans-serif;cursor:pointer;text-decoration:none}
.tth-btn:hover{border-color:var(--th-ac);color:var(--th-ac)}
.tth-btn.main{background:var(--th-ac);border-color:var(--th-ac);color:#FFFDF9}
.tth-btn.main:hover{background:var(--th-ac2);color:#FFFDF9}
.tth-btn.on{background:var(--th-acs);border-color:var(--th-ac);color:var(--th-ac)}
.tth-btn[disabled]{opacity:.6;cursor:wait}
.tth-caps{list-style:none;margin:0;padding:0;border:1px solid var(--th-bd);border-radius:10px;overflow:hidden}
.tth-caps li{display:flex;align-items:center;gap:10px;padding:7px 12px;font-size:13px;color:var(--th-t2);border-top:1px solid var(--th-bd)}
.tth-caps li:first-child{border-top:0}
.tth-caps li .n{width:22px;height:22px;border-radius:50%;background:var(--th-sf2);color:var(--th-t3);font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.tth-caps li .t{flex:1}
.tth-caps li em{font-style:normal;font-size:12px;color:var(--th-t3)}
.tth-caps li.qua .n{background:var(--th-ok);color:#fff}
.tth-caps li.cur{background:var(--th-acs);color:var(--th-ac);font-weight:600}
.tth-caps li.cur .n{background:var(--th-ac);color:#fff}
.tth-note{font-size:12.5px;color:var(--th-t2);margin:8px 0 0}
.tth-note li{margin:2px 0}
.tth-form{display:grid;gap:8px;margin-top:8px}
.tth-form input{width:100%;height:38px;padding:0 12px;border:1px solid var(--th-bd);border-radius:8px;background:var(--th-sf2);color:var(--th-t1);font-size:14px;outline:none;box-shadow:none}
.tth-form input:focus{border-color:var(--th-ac)}
.tth-err{color:#B4442E;font-size:12.5px;min-height:1em;margin:0}
.dark-theme .tth-err,[data-theme="dark"] .tth-err{color:#E8907A}
.tth-link{background:none;border:0;padding:0;color:var(--th-ac);font:600 13px 'Be Vietnam Pro',system-ui,sans-serif;cursor:pointer;text-decoration:underline}
details.tth-det summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--th-t1);padding:4px 0;list-style:none}
details.tth-det summary::-webkit-details-marker{display:none}
details.tth-det summary::before{content:'▸ ';color:var(--th-ac)}
details.tth-det[open] summary::before{content:'▾ '}
.tth-hr{border:0;border-top:1px solid var(--th-bd);margin:0 22px 16px}
@media (max-width:600px){.tth-bd{align-items:flex-end;padding:0}.tth-modal{border-radius:16px 16px 0 0;max-height:88vh;width:100%}}

/* Thông báo cộng điểm */
.tth-toast{position:fixed;left:50%;top:84px;z-index:100020;transform:translate(-50%,-12px);opacity:0;pointer-events:none;display:flex;align-items:center;gap:10px;padding:8px 16px 8px 8px;border-radius:999px;background:var(--th-sf);color:var(--th-t1);border:1px solid var(--th-bd);box-shadow:0 12px 30px rgba(0,0,0,.18);font-size:13.5px;line-height:1.35;transition:all .3s;max-width:92vw}
.tth-toast.show{opacity:1;transform:translate(-50%,0)}
.tth-toast img{width:30px;height:30px;border-radius:50%;object-fit:cover}
.tth-toast b{color:var(--th-ac)}
.tth-toast.lv{background:var(--th-ac);color:#FFFDF9;border-color:var(--th-ac)}
.tth-toast.lv b{color:#FFE9C4}

/* Cảm niệm (bình luận sách) – 1.4.0 */
.tth-bl{--th-sf:#FFFFFF;--th-sf2:#F4EFE6;--th-t1:#2C241E;--th-t2:#685B50;--th-t3:#938578;--th-bd:#E8E0D5;--th-ac:#8B5A2B;--th-ac2:#70461E;--th-acs:rgba(139,90,43,.1);font-size:15px;color:var(--th-t1)}
[data-theme="sepia"] .tth-bl{--th-sf:#FAF3E6;--th-sf2:#EAE0CC;--th-t1:#3B2F23;--th-t2:#6B5846;--th-t3:#8C7762;--th-bd:#DFD1B8;--th-ac:#7D4E24;--th-ac2:#5E3918}
[data-theme="dark"] .tth-bl,.dark-theme .tth-bl{--th-sf:#262220;--th-sf2:#302B28;--th-t1:#EDE8E1;--th-t2:#B8AEA4;--th-t3:#887E75;--th-bd:#3A3430;--th-ac:#D49B58;--th-ac2:#E2B378;--th-acs:rgba(212,155,88,.15)}
.tth-bl *{box-sizing:border-box}
.tth-bl img{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0;background:var(--th-sf2)}
.tth-bl-khoa{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px dashed var(--th-bd);border-radius:14px;background:var(--th-sf2);margin-bottom:18px}
.tth-bl-khoa b{display:block;font-size:14px;color:var(--th-ac2);margin-bottom:3px}
.tth-bl-khoa span{font-size:13px;line-height:1.55;color:var(--th-t2)}
.tth-bl-khoa span b{display:inline;color:var(--th-t1)}
.tth-bl-f{border:1px solid var(--th-bd);border-radius:14px;background:var(--th-sf);padding:14px;margin-bottom:18px}
.tth-bl-who{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--th-t2);margin-bottom:10px}
.tth-bl-who img{width:32px;height:32px}
.tth-bl-who b{color:var(--th-t1)}
.tth-bl-f textarea{width:100%;min-height:84px;resize:vertical;padding:10px 12px;border:1px solid var(--th-bd);border-radius:10px;background:var(--th-sf2);color:var(--th-t1);font:inherit;font-size:15px;line-height:1.6;outline:none}
.tth-bl-f textarea:focus{border-color:var(--th-ac);box-shadow:0 0 0 3px var(--th-acs)}
.tth-bl-ft{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.tth-bl-err{color:#c0392b;font-size:12px}
.tth-bl-f button,.tth-bl-more button{border:0;border-radius:10px;padding:10px 18px;background:var(--th-ac);color:#fff;font:inherit;font-size:14px;font-weight:600;cursor:pointer;flex-shrink:0}
.tth-bl-f button:disabled{opacity:.6;cursor:wait}
.tth-bl-it{display:flex;gap:12px;padding:14px 0;border-top:1px solid var(--th-bd)}
.tth-bl-it:first-child{border-top:0}
.tth-bl-it.cho{opacity:.7}
.tth-bl-bd{flex:1;min-width:0}
.tth-bl-hd{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:13px}
.tth-bl-hd b{font-size:14px;color:var(--th-t1)}
.tth-bl-cap{padding:1px 8px;border-radius:99px;background:var(--th-acs);color:var(--th-ac2);font-size:11px;font-weight:600}
.tth-bl-hd time{color:var(--th-t3);font-size:12px}
.tth-bl-cho{color:#b9770e;font-size:11px}
.tth-bl-nd{margin-top:4px;font-size:15px;line-height:1.65;color:var(--th-t2);overflow-wrap:anywhere}
.tth-bl-nd p{margin:0 0 6px}
.tth-bl-empty{margin:6px 0;color:var(--th-t3);font-size:14px;text-align:center}
.tth-bl-more{text-align:center;margin-top:8px}
.tth-bl-more button{background:var(--th-sf2);color:var(--th-t1);border:1px solid var(--th-bd)}

/* Bảng xếp hạng tu tập – 1.5.0 */
.tth-xh-tabs{display:flex;gap:4px;padding:3px;background:var(--th-sf2);border-radius:999px;margin-bottom:10px}
.tth-xh-tabs button{flex:1;height:30px;border:0;border-radius:999px;background:transparent;color:var(--th-t2);font:600 12.5px 'Be Vietnam Pro',system-ui,sans-serif;cursor:pointer;padding:0 8px}
.tth-xh-tabs button.on{background:var(--th-sf);color:var(--th-ac);box-shadow:0 1px 4px rgba(44,36,30,.12)}
.tth-xh-list{list-style:none;margin:0;padding:0;border:1px solid var(--th-bd);border-radius:12px;overflow:hidden}
.tth-xh-list li{display:flex;align-items:center;gap:10px;padding:7px 12px;border-top:1px solid var(--th-bd);font-size:13px;color:var(--th-t1)}
.tth-xh-list li:first-child{border-top:0}
.tth-xh-list li .h{width:24px;text-align:center;font-size:13px;font-weight:700;color:var(--th-t3);flex-shrink:0}
.tth-xh-list li.top1 .h,.tth-xh-list li.top2 .h,.tth-xh-list li.top3 .h{font-size:18px}
.tth-xh-list li img{width:34px;height:34px;border-radius:50%;object-fit:cover;flex-shrink:0;background:var(--th-sf2)}
.tth-xh-list li .t{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.tth-xh-list li .t b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tth-xh-list li .t b i{font-style:normal;font-weight:500;color:var(--th-ac);font-size:12px}
.tth-xh-list li .t small{font-size:11.5px;color:var(--th-t3)}
.tth-xh-list li em{font-style:normal;font-weight:700;color:var(--th-ac);text-align:right;line-height:1.1;flex-shrink:0}
.tth-xh-list li em small{display:block;font-size:10.5px;font-weight:500;color:var(--th-t3)}
.tth-xh-list li.top1{background:linear-gradient(90deg,rgba(212,160,60,.14),transparent)}
.tth-xh-list li.toi{background:var(--th-acs)}
.tth-xh-list li.gap{justify-content:center;padding:2px;color:var(--th-t3);font-size:14px;letter-spacing:2px}
