:root {
  --brand: #b5121b;
  --brand-dark: #8f0e15;
  --brand-soft: #fdeceb;
  --ink: #1d2126;
  --ink-2: #4a525c;
  --ink-3: #7a838e;
  --line: #e3e6ea;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ok: #1d7a46;
  --ok-soft: #e5f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff4dd;
  --info: #1f5fa8;
  --info-soft: #e7f0fb;
  --gray-soft: #eef0f2;
  --radius: 12px;
  --nav-h: 64px;
  --side-w: 232px;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--info); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; }
.boot { padding: 40px; text-align: center; color: var(--ink-3); }

/* ---------- khung ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar .back { color: #fff; font-size: 1.5rem; line-height: 1; padding: 2px 8px 2px 0; background: none; border: 0; cursor: pointer; }
.topbar .title { font-weight: 650; font-size: 1.05rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { font-size: .82rem; opacity: .9; text-align: right; }
.demo-banner { background: #ffde59; color: #3a2f00; font-size: .8rem; text-align: center; padding: 4px 8px; font-weight: 600; }
main { padding: 14px 14px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a, .bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: .72rem; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.bottomnav .ico { font-size: 1.3rem; line-height: 1; }
.bottomnav .active { color: var(--brand); font-weight: 650; }
.sidenav { display: none; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w);
    background: #fff; border-right: 1px solid var(--line); padding: 16px 10px; gap: 2px; z-index: 25;
  }
  .sidenav .brand { font-weight: 750; color: var(--brand); padding: 6px 12px 16px; font-size: 1.05rem; }
  .sidenav a { padding: 10px 12px; border-radius: 8px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
  .sidenav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
  .sidenav .spacer { flex: 1; }
  .shell { margin-left: var(--side-w); }
  main { padding-bottom: 40px; }
}

/* ---------- thẻ, danh sách ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; }
.card > h2, .card > h3 { margin-bottom: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 2px 8px; }
.section-title h2 { font-size: 1rem; color: var(--ink-2); }
.count { background: var(--gray-soft); color: var(--ink-2); border-radius: 99px; padding: 0 8px; font-size: .8rem; font-weight: 600; }
.empty { color: var(--ink-3); text-align: center; padding: 18px 8px; font-size: .92rem; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }
.pre { white-space: pre-wrap; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

.tcard {
  display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; padding: 12px; margin-bottom: 10px; color: inherit;
}
.tcard:active { background: #fafafa; }
.tcard.p-khan { border-left-color: var(--brand); }
.tcard.p-cao { border-left-color: #e08a00; }
.tcard.overdue { background: #fff5f4; border-color: #f3c4c0; }
.tcard.unassigned { background: #fff8e1; border: 2px dashed #e0a100; border-left: 6px solid #e0a100; }
.chip.chip-unassigned { background: #e0a100; color: #fff; font-weight: 700; }
.tcard .l1 { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tcard .code { font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.tcard .who { font-weight: 600; margin-top: 4px; }
.tcard .meta { color: var(--ink-3); font-size: .85rem; margin-top: 3px; }
.tcard .req { margin-top: 4px; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.chip { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: .78rem; font-weight: 650; white-space: nowrap; background: var(--gray-soft); color: var(--ink-2); }
.st-moi_tao { background: var(--gray-soft); color: var(--ink-2); }
.st-da_phan_cong { background: var(--info-soft); color: var(--info); }
.st-da_nhan { background: #ece8fb; color: #5b3fb5; }
.st-dang_xu_ly { background: #e0f2f7; color: #0d6a80; }
.st-cho_duyet { background: var(--warn-soft); color: var(--warn); }
.st-hoan_thanh { background: var(--ok-soft); color: var(--ok); }
.st-cho_vat_tu, .st-hen_lai { background: #fde8d7; color: #9b4a07; }
.st-huy { background: #eee; color: #777; text-decoration: line-through; }
.badge-red { background: var(--brand-soft); color: var(--brand); }
.badge-amber { background: var(--warn-soft); color: var(--warn); }
.badge-green { background: var(--ok-soft); color: var(--ok); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .tiles.six { grid-template-columns: repeat(6, 1fr); } }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: inherit; display: block; }
.tile .n { font-size: 1.7rem; font-weight: 750; line-height: 1.1; }
.tile .k { color: var(--ink-3); font-size: .82rem; }
.tile.alert .n { color: var(--brand); }
.tile.amber .n { color: var(--warn); }

.kv { display: grid; grid-template-columns: 112px 1fr; gap: 6px 10px; font-size: .94rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-word; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--ink-3); font-weight: 600; font-size: .8rem; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- nút ---------- */
button, .btn {
  font-family: inherit; font-size: .95rem; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); padding: 10px 14px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; font-weight: 600; text-decoration: none;
}
button:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-warn { background: #e08a00; border-color: #e08a00; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--info); padding-left: 6px; padding-right: 6px; }
.btn-danger { color: var(--brand); border-color: #f2c4c6; }
.btn-sm { min-height: 34px; padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn-big { min-height: 58px; font-size: 1.08rem; border-radius: 12px; width: 100%; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .full { grid-column: 1 / -1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- biểu mẫu ---------- */
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: .85rem; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
.f > span .req { color: var(--brand); }
input, select, textarea {
  font-family: inherit; font-size: 16px; width: 100%; padding: 10px 12px; border: 1px solid #cfd4da; border-radius: 10px;
  background: #fff; color: var(--ink); min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #f0a1a5; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.grid2 > * { min-width: 0; }
.grid2 input, .grid2 select { min-width: 0; max-width: 100%; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.filters > * { min-width: 0; }
.filters .full { grid-column: 1 / -1; }
@media (min-width: 760px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seg { display: flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; min-height: 40px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pick { border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; }
.pick .opt { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick .opt:last-child { border-bottom: 0; }
.pick .opt:hover, .pick .opt.on { background: var(--brand-soft); }
.chosen { background: var(--ok-soft); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start; }
.tech-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.tech-row:last-child { border-bottom: 0; }
.tech-row .nm { flex: 1; min-width: 0; }
.tech-row .veh-pick { display: block; width: 100%; margin-top: 6px; font-size: .82rem; padding: 6px 8px; }
.tech-row .prim { display: flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--ink-2); }

/* ---------- phiếu ---------- */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ticket-head .code { font-size: 1.15rem; font-weight: 750; }
.alert-box { background: var(--warn-soft); border: 1px solid #f2d79a; color: #6b4200; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }
.alert-box ul { margin: 4px 0 0; padding-left: 18px; }
.reason-box { background: #fff7f0; border-left: 3px solid #e08a00; padding: 8px 10px; border-radius: 6px; font-size: .9rem; margin-top: 8px; }
.onsite { background: #e0f2f7; color: #0d6a80; border-radius: 10px; padding: 10px 12px; font-weight: 650; margin-bottom: 10px; text-align: center; }
.person { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.person.removed { opacity: .55; }
.log { display: flex; justify-content: space-between; gap: 6px; font-size: .9rem; padding: 6px 0; border-top: 1px dashed var(--line); align-items: center; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 640px) { .photos { grid-template-columns: repeat(5, 1fr); } }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--gray-soft); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photos .ph .x { position: absolute; top: 4px; right: 4px; min-height: 0; width: 28px; height: 28px; padding: 0; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 1rem; }
.addph { aspect-ratio: 1; border: 2px dashed #cfd4da; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--ink-3); font-size: .8rem; cursor: pointer; background: #fff; }
.addph b { font-size: 1.6rem; line-height: 1; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
details > summary { cursor: pointer; font-weight: 650; color: var(--ink-2); padding: 4px 0; }

/* ---------- lịch ---------- */
.sched-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .sched-row { grid-template-columns: 200px 1fr; } }
.sched-row .nm { font-weight: 650; }
.sched-items { display: flex; gap: 6px; flex-wrap: wrap; }
.sched-item { background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 6px 9px; font-size: .84rem; }
.sched-item.prim { background: var(--brand-soft); color: var(--brand); }

/* ---------- hộp thoại, thông báo ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 22, .5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.modal h2 { margin-bottom: 12px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; position: sticky; bottom: -16px; background: #fff; padding: 8px 0; }
.modal .foot button { flex: 1; }
@media (min-width: 640px) { .modal .foot button { flex: 0 0 auto; min-width: 120px; } }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 120; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; }
.lightbox button { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; background: rgba(255,255,255,.2); color: #fff; border: 0; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); }
.toast { background: #23272d; color: #fff; padding: 11px 14px; border-radius: 10px; font-size: .92rem; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.err { background: var(--brand); }
.toast.ok { background: var(--ok); }

/* ---------- đăng nhập ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #b5121b 0%, #6e0a10 100%); }
.auth .box { background: #fff; border-radius: 16px; padding: 26px 22px; width: 100%; max-width: 380px; }
.auth .logo { font-weight: 800; color: var(--brand); font-size: 1.35rem; margin-bottom: 2px; }
.auth .sub { color: var(--ink-3); margin-bottom: 20px; font-size: .9rem; }
.auth .err { color: var(--brand); font-size: .9rem; min-height: 1.3em; margin-bottom: 8px; }

.cgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .cgrid { grid-template-columns: 1fr 1fr; } }
.cgrid .person .photos { grid-template-columns: repeat(3, 1fr); }

.wb { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: var(--ink-2, #333); margin-top: 3px; }
.wb.ok { background: #e6f6ec; color: #17733d; }
.wb.bad { background: #fde8e8; color: #b42318; }
.wb.warn { background: #fff4e0; color: #9a5b00; }

.pchip { background: #e8f0fe; color: #1a4fa0; font-weight: 600; }

.ph { position: relative; }
.ph .phtime { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; padding: 1px 5px; border-radius: 4px; pointer-events: none; }

.wb.pend { background: #efe6fb; color: #5b2a9a; }
.wb.info { background: #e6f0fb; color: #1a4fa0; }
.att-ok { border-left: 4px solid #2e9e5b; }
.att-warn { border-left: 4px solid #d99a00; }
.att-bad { border-left: 4px solid #c62828; }
.att-pend { border-left: 4px solid #7b3fc4; }
.att-info { border-left: 4px solid #3b7bd4; }
.attgrid th, .attgrid td.ac { padding: 4px 3px; text-align: center; font-size: .78rem; min-width: 26px; }
.attgrid td.ac { border-left: none; font-weight: 700; }
.attgrid td.ac.att-ok { background: #e6f6ec; color: #17733d; }
.attgrid td.ac.att-warn { background: #fff4e0; color: #9a5b00; }
.attgrid td.ac.att-bad { background: #fde8e8; color: #b42318; }
.attgrid td.ac.att-pend { background: #efe6fb; color: #5b2a9a; }
.attgrid td.ac.att-info { background: #e6f0fb; color: #1a4fa0; }
.attgrid .off { background: #f3f4f6; color: #9aa0a6; }
.attcard .btn-big { flex: 1; }
.attgrid td:first-child, .attgrid th:first-child { min-width: 150px; text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }

/* phiếu vừa xem, tô sáng khi quay lại danh sách */
.flash { animation: flash 2.5s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--brand); background: #fdecec; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- bảng tin ---------- */
.nbadge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; margin-left: auto; }
.nbadge[hidden] { display: none; }
.bottomnav .ico { position: relative; }
.bottomnav .ico .nbadge { position: absolute; top: -6px; right: -12px; margin: 0; }
.seg a, .seg label { flex: 1; text-align: center; padding: 9px 6px; border-radius: 8px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; justify-content: center; align-items: center; }
.seg a.on, .seg label:has(input:checked) { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ncard { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; color: inherit; }
.ncard.p-khan, .news-post.p-khan, .nb-item.p-khan { border-left-color: var(--brand); }
.ncard.p-quan_trong, .news-post.p-quan_trong, .nb-item.p-quan_trong { border-left-color: #e08a00; }
.ncard.unread { background: #fffaf9; }
.ncard.unread .ntitle { font-weight: 750; }
.ncard .nbody { flex: 1; min-width: 0; }
.ncard .l1 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 4px; }
.ncard .ntitle { font-weight: 650; font-size: 1.02rem; margin: 4px 0 2px; }
.ncard .nsnip { color: var(--ink-2); font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 4px; }
.nthumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: var(--gray-soft); }
.dot-new { background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: .72rem; font-weight: 700; }
.news-post { border-left: 4px solid var(--line); }
.news-text { margin: 14px 0; white-space: normal; line-height: 1.55; word-break: break-word; font-size: 1rem; }
.file-link { justify-content: flex-start; text-align: left; }
.news-banner { border-left: 4px solid var(--brand); }
.nb-item { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 0 8px 10px; border-left: 3px solid var(--line); margin-top: 8px; color: inherit; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; margin-bottom: 10px; }
.pick-row { padding: 6px 0; }
.pick-grid [hidden] { display: none; }

/* ---------- lương ---------- */
.paytbl td.num, .paytbl th.num { white-space: nowrap; }
.tbl tr.tot td { border-top: 2px solid var(--ink-3); background: var(--gray-soft); }
.payslip .tbl th[colspan] { background: var(--gray-soft); color: var(--ink-2); }
.print-only { display: none; }
.sign-row { justify-content: space-around; margin-top: 28px; text-align: center; font-weight: 600; }
.sign-row div { flex: 1; padding-bottom: 70px; }
@media print {
  .sidenav, .bottomnav, .topbar, .no-print, .demo-banner, .toast, .nbadge { display: none !important; }
  body, .shell { background: #fff !important; }
  main { padding: 0 !important; max-width: none !important; }
  .shell { margin: 0 !important; padding: 0 !important; }
  .card { border: 0 !important; box-shadow: none !important; }
  .print-only { display: flex !important; }
}
.tcard .l1 .row { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

/* chuông thông báo */
.topbar .bell { color: #fff; font-size: 1.15rem; position: relative; padding: 2px 4px; text-decoration: none; }
.topbar .bell .nbadge { position: absolute; top: -6px; right: -10px; background: #fff; color: var(--brand); }
label.row { flex-wrap: nowrap; align-items: flex-start; }
label.row > input[type=checkbox] { flex: none; margin-top: 1px; }

/* bản in danh sách phiếu / KPI */
.print-block { display: none; }
.ptbl { font-size: .82rem; }
.ptbl tr.pdet td { border-top: 0; padding-top: 0; color: #333; }
@media print {
  .print-block { display: block !important; }
  .ptbl th, .ptbl td { padding: 4px 4px; }
  .ptbl tr { page-break-inside: avoid; }
  .tiles { grid-template-columns: repeat(4, 1fr) !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
