/* Tu học GĐPT – tien-ich.css: chỉnh giao diện (30/11/2026) và kiểu cho các tiện ích mới. Nạp sau style.css. */

/* ---------- chỉnh giao diện ---------- */
/* Trang chủ, điện thoại: ba thẻ Huynh trưởng / Đoàn sinh / Phụ huynh xếp dọc, không phải vuốt ngang */
@media (max-width:640px){
  .aud{display:grid;grid-template-columns:minmax(0,1fr);overflow:visible;margin-inline:0;padding:0;gap:8px;scroll-snap-type:none}
  .audc{flex:none;padding:12px 14px}
  .audc span{font-size:.86rem}
}
/* Mũi tên "Mở bản đồ →" không rớt xuống dòng riêng */
.tc-it .tc-go span{display:inline;position:static;font:inherit;color:inherit}
/* Chữ nhãn quá nhỏ: nâng lên tối thiểu khoảng 11,5px */
.nhan{font-size:.72rem}
table.stack td[data-label]::before{font-size:.72rem}
@media (max-width:640px){table.stack td[data-label]::before{font-size:.7rem}}
.lich-tile small{font-size:.7rem}
.lp-mini .lp-mg b{font-size:.7rem}
@media (max-width:420px){.node .sub{font-size:.7rem}}
/* Trang chủ: thẻ Dòng thời gian Lam sử nằm ngang, trọn một hàng */
.tc-grid>.ls-the{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;align-content:center;gap:2px 18px;min-height:0}
.tc-grid>.ls-the .tc-ic{grid-row:1 / 3}
.tc-grid>.ls-the b{margin-top:0}
.tc-grid>.ls-the em{grid-column:3;grid-row:1 / 3;margin:0;padding:0}
@media (max-width:640px){.tc-grid>.ls-the{grid-template-columns:auto minmax(0,1fr)}.tc-grid>.ls-the em{grid-column:2;grid-row:auto}}
/* Lịch: ô chọn Hiệp kỵ địa phương nằm gọn một hàng */
.lp-bhd{display:flex;flex-wrap:wrap;width:100%;margin-top:6px}
.lp-bhd select{flex:1 1 12rem;max-width:22rem}
/* Lịch: phần nguồn dài được gấp lại */
.lp-src-d{margin-top:28px;border-top:1px solid var(--line);padding-top:12px}
.lp-src-d>summary{cursor:pointer;color:var(--muted);font-size:.86rem;font-weight:600}
.lp-src-d .lp-src{margin-top:8px;border:0;padding-top:0}
/* Trang 404 */
main.wrap.lvl>.lhead:first-child{padding:36px 0 8px}
/* Trang bậc: hàng công cụ trên danh sách bài không rớt chữ */
.ltr{flex-wrap:wrap;justify-content:flex-end;gap:2px 10px}
.ltr>*{white-space:nowrap}
.ti-404{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 48px;padding:0;list-style:none}
.ti-404 a{display:inline-block;padding:8px 14px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--lam);text-decoration:none;font-weight:600;font-size:.92rem}
.ti-404 a:hover{border-color:var(--lam)}
/* Phiếu thực hành: mỗi ô đánh dấu một dòng */
.phieu .ti-ck{margin:4px 0}

/* ---------- thanh công cụ trong bài ---------- */
.ti-bar{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 12px}
.ti-b{font:inherit;font-size:.82rem;font-weight:600;line-height:1.2;padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--lam);cursor:pointer;min-height:34px}
.ti-b:hover{border-color:var(--lam)}
.ti-b:focus-visible{outline:2px solid var(--lam);outline-offset:2px}
.ti-b.dang{background:var(--lam);color:var(--surface);border-color:var(--lam)}
.ti-nghe{display:none}
.co-giong-vi .ti-nghe{display:inline-block}
.ti-bar-ts{margin:6px 0 12px}
.ti-luu{white-space:nowrap}
.ti-an{position:fixed;left:-9999px;top:0;opacity:0}
.ti-toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translate(-50%,20px);z-index:60;max-width:min(92vw,420px);margin:0;
  padding:10px 16px;border-radius:12px;background:var(--ink);color:var(--surface);font-size:.9rem;line-height:1.45;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.ti-toast.on{opacity:1;transform:translate(-50%,0)}

/* ---------- in một bài ---------- */
.in-dau{display:none}
@media print{
  body.in-mot .in-an{display:none!important}
  body.in-mot main,body.in-mot .wrap,body.in-mot .lgrid,body.in-mot .lessons,body.in-mot section{margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:none!important;max-width:none!important;display:block!important}
  body.in-mot .in-dau{display:block;font-size:9pt;color:#555;margin:0 0 8pt;border-bottom:1px solid #999;padding-bottom:4pt}
  body.in-mot .ti-bar,body.in-mot .dg,body.in-mot .stt,body.in-mot .quiz,body.in-mot .bgm-cta,body.in-mot .ckb,body.in-mot .badges,body.in-mot .chev,body.in-mot .ti-toast{display:none!important}
  body.in-mot .lesson{list-style:none;border:0!important}
  body.in-mot .ld>summary{font-size:15pt;font-weight:700;padding:0 0 6pt!important;list-style:none}
  body.in-mot .ld>summary::-webkit-details-marker{display:none}
  body.in-mot .doc{padding:0!important;border:0!important;font-size:11pt}
  body.in-mot img{max-width:60%;height:auto}
  body.in-mot a{color:#000}
}

/* ---------- trang Sao lưu tiến độ, trang Mất mạng ---------- */
.sl-box{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);padding:18px;margin:16px 0}
.sl-box h2{margin-top:0}
.sl-tom{font-weight:600;color:var(--lam)}
.sl-nut{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 4px}
.sl-box textarea{width:100%;min-height:90px;font:inherit;font-size:.85rem;border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--surface-2,var(--surface));color:var(--ink)}
.sl-box input[type=file]{font:inherit;font-size:.9rem;max-width:100%}
.sl-kq{min-height:1.5em;font-weight:600;color:var(--lam)}
.sl-kq.loi{color:#b3261e}
.ds-da-luu{columns:2 16rem;column-gap:24px;padding-left:18px}
.ds-da-luu li{break-inside:avoid;margin:0 0 6px}

/* ---------- Dòng thời gian Lam sử ---------- */
.ls-gd{margin:36px 0 8px;font-size:1.25rem}
.ls-gd small{display:block;font-family:var(--body);font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--gold);margin-bottom:2px}
.ls-tl{list-style:none;margin:0;padding:0 0 0 22px;border-left:3px solid var(--lam-soft,#dbe7f0);position:relative}
.ls-tl>li{position:relative;margin:0 0 18px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.ls-tl>li::before{content:"";position:absolute;left:-31px;top:20px;width:13px;height:13px;border-radius:50%;background:var(--surface);border:3px solid var(--lam)}
.ls-nam{display:inline-block;font-family:var(--display);font-weight:700;font-size:1.15rem;color:var(--lam);margin-right:8px}
.ls-ngay{font-size:.84rem;color:var(--muted)}
.ls-tl h3{margin:4px 0 6px;font-size:1.05rem;line-height:1.4}
.ls-tl p{margin:0 0 6px}
.ls-lk{font-size:.86rem;margin:6px 0 0!important}
.ls-lk a{font-weight:600}
.ls-nguon{font-size:.84rem;color:var(--muted)}
.ls-nguon li{margin-bottom:4px}
@media (max-width:640px){.ls-tl{padding-left:16px}.ls-tl>li{padding:12px}.ls-tl>li::before{left:-25px}}
@media print{.ls-tl>li{break-inside:avoid}}

/* ---------- Lam sử: lời dẫn, mốc lớn, con số, lời kết (02/12/2026) ---------- */
.lam-su .ls-mo{font-size:1rem;line-height:1.7;color:var(--muted);margin:0 0 14px}
.ls-dan{margin:4px 0 20px;padding:12px 16px;border-left:4px solid var(--gold);background:var(--surface-2,var(--surface));border-radius:0 var(--radius) var(--radius) 0;line-height:1.75;font-style:italic}
.ls-tl>li.ls-lon{border:2px solid var(--lam)}
.ls-tl>li.ls-lon::before{background:var(--lam);width:15px;height:15px;left:-33px}
.ls-tl>li.ls-lon h3{font-size:1.12rem}
.ls-so{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:8px 0 6px}
.ls-so li{font-size:.82rem;font-weight:700;padding:3px 10px;border-radius:999px;background:var(--lam-soft,#dce8f1);color:var(--lam)}
.ls-ket{margin:34px 0 8px;padding:18px 20px;border:1px solid var(--line);border-top:4px solid var(--lam);border-radius:var(--radius);background:var(--surface-2,var(--surface))}
.ls-ket p{margin:0;font-size:1.05rem;line-height:1.8}
@media (max-width:640px){.ls-tl>li.ls-lon::before{left:-27px}}
/* ---------- hết Lam sử 02/12 ---------- */

/* ---------- Bài Lam: khung Đọc thêm trong bài học (02/12/2026) ---------- */
.bl-xua{margin:18px 0;padding:14px 16px;border:1px dashed var(--gold);border-radius:var(--radius);background:var(--surface)}
.bl-xua>p:first-child{font-weight:700;color:var(--gold);text-transform:uppercase;letter-spacing:.05em;font-size:.84rem;margin:0 0 6px}
.bl-xua p{line-height:1.7}
.bl-xua .bl-xem{margin:8px 0 0;font-size:.92rem}
.bl-nd{margin:2px 0 8px;padding:0 14px 0 46px;font-size:.86rem;color:var(--muted)}
.bl-nd a{font-weight:600}
@media print{.bl-xua{break-inside:avoid}}
/* ---------- hết Bài Lam 02/12 ---------- */
