/* รอบ 39: โอนสินค้าระหว่างสาขา (/transfers + Components/TransferEditor.razor + TransferReceive.razor + TransferPrint.razor)
   - โครง .fit ของ fit.css + ชิ้นส่วนของ purchase.css ซ้ำ (.po-views แท็บ, .po-st ป้ายสถานะ, .po-table ตาราง/การ์ดมือถือ, .po-q, .grn-d-wait)
     + quotes.css (.qt-ed-* ฟอร์ม, .qt-presults, .qt-d-*) + expenses.css (.exp-periods, .exp-chip, .exp-toast, .pl-branch)
   - สีสถานะผ่านตัวแปร --ps (.ts-sent / .ts-received / .ts-short / .ts-cancelled) ใช้ตัวแปรธีม → โหมดมืด override ท้ายไฟล์
   - ตัวเลือกขึ้นต้นด้วย .tr-fit / .tr-ed / .tr-rc เพื่อชนะกฎของ purchase.css โดยไม่ขึ้นกับลำดับไฟล์
   - พิมพ์: html[data-print="tr"] → พิมพ์เฉพาะ .tr-print บนกระดาษ A4 (ผูกด้วย :has() ไม่กระทบการพิมพ์หน้าอื่น) */

@media screen {
  /* ---------- สีสถานะ ---------- */
  .ts-sent { --ps: #B7791F; }
  .ts-received { --ps: var(--ok); }
  .ts-short { --ps: var(--danger); }
  .ts-cancelled { --ps: #8A817A; }
  .ts-all { --ps: var(--ink); }
  .po-st.ts-cancelled { text-decoration: line-through; text-decoration-thickness: 1.5px; }

  /* ---------- หัว + แท็บ ---------- */
  .tr-head-main { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 18px; min-width: 0; }
  .tr-views-n {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--line); color: var(--ink); font-size: .72rem; font-weight: 800; line-height: 1;
  }
  .tr-fit .tr-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tr-stat-in { box-shadow: var(--shadow), inset 3px 0 0 var(--line); }
  .tr-stat-in.warn { background: color-mix(in srgb, #B7791F 11%, var(--surface)); box-shadow: var(--shadow), inset 3px 0 0 #B7791F; }
  .tr-stat-in.warn strong { color: #8A5A10; }
  .tr-stat-in small, .tr-stat-out small { font-size: .78rem; color: var(--muted); }
  .tr-stat-out { box-shadow: var(--shadow), inset 3px 0 0 #2F6FB3; }
  .tr-stat-old.bad, .tr-stat-short.bad { box-shadow: var(--shadow), inset 3px 0 0 var(--danger); }
  .tr-stat-old.bad strong, .tr-stat-short.bad strong { color: var(--danger); }

  /* ---------- รายการ ---------- */
  .tr-tab-note { margin: 0 0 6px; padding: 2px 4px 8px; border-bottom: 1px dashed var(--line); color: var(--muted); font-size: .82rem; }
  .tr-fit .tr-table td { vertical-align: middle; }
  .tr-c-no { white-space: nowrap; }
  .tr-c-no strong { font-weight: 700; font-size: .9rem; }
  .tr-c-date { white-space: nowrap; color: var(--muted); font-size: .84rem; }
  .tr-c-date > span { display: block; }
  .tr-age { display: inline-block; margin-top: 2px; padding: 0 7px; border-radius: 999px; background: var(--warn-soft); color: #8A5A10; font-size: .7rem; font-weight: 700; }
  .tr-age.old { background: var(--danger-soft); color: var(--danger); }
  .tr-c-route { min-width: 0; max-width: 420px; }
  .tr-route { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .tr-route svg { flex: none; color: var(--muted); }
  .tr-route-b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .tr-route-b.to { color: var(--ink); }
  .tr-dir { flex: none; padding: 0 7px; border-radius: 6px; font-size: .7rem; font-weight: 800; line-height: 1.6; }
  .tr-dir.in { background: var(--ok-soft); color: var(--ok); }
  .tr-dir.out { background: color-mix(in srgb, #2F6FB3 12%, var(--surface)); color: #2F6FB3; }
  .tr-c-items { white-space: nowrap; color: var(--muted); font-size: .86rem; }
  .tr-c-val { white-space: nowrap; }
  .tr-c-val strong { display: block; font-weight: 700; }
  .tr-short-tag { display: block; color: var(--danger); font-size: .74rem; font-weight: 700; }
  .tr-c-status { white-space: nowrap; }
  .tr-c-by { white-space: nowrap; font-size: .86rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  .tr-c-act { width: 52px; padding-left: 0 !important; text-align: center; }
  .tr-fit .tr-row.ts-sent td:first-child { box-shadow: inset 3px 0 0 var(--ps); }
  .tr-fit .tr-row.ts-cancelled td { color: var(--muted); }
  .tr-fit .tr-row.ts-cancelled .tr-c-val strong { text-decoration: line-through; }

  /* ---------- ลิ้นชัก ---------- */
  .tr-d-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
  .tr-d-node { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; line-height: 1.3; }
  .tr-d-node small { color: var(--muted); font-size: .74rem; font-weight: 700; }
  .tr-d-node strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tr-d-node span { font-size: .76rem; overflow-wrap: anywhere; }
  .tr-d-node.to { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-tint); }
  .tr-d-line {
    position: relative; display: grid; place-items: center; width: 64px; height: 36px; color: var(--ps);
  }
  .tr-d-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed color-mix(in srgb, var(--ps) 55%, transparent); }
  .tr-d-line svg { position: relative; padding: 4px; border-radius: 10px; background: var(--surface); box-sizing: content-box; }
  .tr-d-line.ts-received::before, .tr-d-line.ts-short::before { border-top-style: solid; }
  .tr-d-hero .qt-d-hero-main small { white-space: normal; }
  .tr-cancel-box .field { margin: 0 0 8px; }
  .tr-cancel-box textarea { width: 100%; resize: vertical; }
  .tr-d-lines li.short { box-shadow: inset 3px 0 0 var(--danger); padding-left: 10px; }

  /* ---------- ฟอร์มส่งโอน ---------- */
  .tr-ed .qt-ed-tools .btn { min-height: 42px; }
  .tr-send-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 140px; justify-content: center; }
  .tr-lines-wrap.table-wrap { border: 0; border-radius: 0; background: transparent; }
  .tr-lines th { padding: 8px 6px; font-size: .8rem; white-space: nowrap; }
  .tr-lines td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .tr-lines tr:last-child td { border-bottom: 0; }
  .tr-lines .tr-l-no { width: 30px; text-align: center; color: var(--muted); padding-top: 14px; font-size: .84rem; }
  .tr-lines .tr-l-prod { min-width: 200px; padding-top: 9px; }
  .tr-l-name { display: block; font-weight: 600; font-size: .92rem; line-height: 1.3; overflow-wrap: anywhere; }
  .tr-l-prod small { display: block; font-size: .74rem; line-height: 1.35; }
  .tr-lines .tr-l-unit { width: 120px; }
  .tr-lines .tr-l-qty { width: 110px; }
  .tr-lines .tr-l-hand { width: 170px; padding-top: 14px; font-size: .86rem; }
  .tr-lines .tr-l-act { width: 48px; padding-top: 8px; text-align: center; }
  .tr-lines select.qt-in { padding-right: 4px; }
  .tr-over { display: block; margin-top: 2px; color: var(--danger); font-size: .72rem; font-weight: 700; }
  .tr-line.over td { background: color-mix(in srgb, var(--danger) 5%, transparent); }
  .tr-route-form { display: flex; flex-direction: column; gap: 4px; }
  .tr-route-form .field { margin: 0; }
  .tr-route-arrow { align-self: center; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong, var(--brand)); }
  .tr-ed-mbar { display: none; }

  /* ---------- ป๊อปอัปรับของ ---------- */
  .tr-rc { display: flex; flex-direction: column; gap: 12px; }
  .tr-rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
  .tr-rc-head .tr-route { font-size: 1rem; }
  .tr-rc-head > small { font-size: .8rem; }
  .tr-rc-all { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; font-size: .86rem; font-weight: 700; padding: 6px 14px; }
  .tr-rc-all.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
  .tr-rc-note { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--chip); font-size: .86rem; }
  .tr-rc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: min(46vh, 480px); overflow: auto; }
  .tr-rc-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .tr-rc-row.short { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); box-shadow: inset 3px 0 0 var(--danger); }
  .tr-rc-row.flag { background: var(--danger-soft); }
  .tr-rc-main { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px; align-items: center; gap: 8px 14px; }
  .tr-rc-prod { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  .tr-rc-prod strong { font-weight: 600; font-size: .94rem; overflow-wrap: anywhere; }
  .tr-rc-prod small { font-size: .74rem; }
  .tr-rc-sent, .tr-rc-got { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .tr-rc-sent small, .tr-rc-got small { color: var(--muted); font-size: .72rem; }
  .tr-rc-got .qt-in { width: 100%; min-height: 40px; font-weight: 700; }
  .tr-rc-sent-btn { width: 100%; min-height: 40px; padding: 0 10px; border: 1px dashed var(--line); border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
  .tr-rc-sent-btn:hover { border-color: var(--ok); background: var(--ok-soft); }
  .tr-rc-err { margin: 0; color: var(--danger); font-size: .8rem; font-weight: 600; }
  .tr-rc-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, var(--danger) 30%, var(--line)); }
  .tr-rc-short { color: var(--danger); font-size: .84rem; font-weight: 700; }
  .tr-rc-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
  .tr-rc-rs {
    min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    color: var(--ink); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  }
  .tr-rc-rs:hover { border-color: var(--danger); }
  .tr-rc-rs.on { border-color: var(--danger); background: var(--danger); color: #fff; }
  .tr-rc-other { flex: 1 1 200px; min-height: 34px; }
  .tr-rc-notef { margin: 0; }
  .tr-rc-notef textarea { width: 100%; resize: vertical; }
  .tr-rc-foot {
    position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    margin: 0 -22px; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
  }
  .tr-rc-foot .actions { position: static; margin: 0; padding: 0; border: 0; background: none; display: flex; gap: 8px; }
  .tr-rc-sum { display: flex; flex-wrap: wrap; gap: 6px 22px; }
  .tr-rc-sum > span { display: flex; flex-direction: column; line-height: 1.25; }
  .tr-rc-sum small { color: var(--muted); font-size: .74rem; }
  .tr-rc-sum strong { font-size: 1rem; }
  .tr-rc-sum .bad strong { color: var(--danger); font-size: 1.15rem; }

  /* ---------- แถบแนะนำในหน้า /inventory (ใบโอนทันที) ---------- */
  .tr-inv-hint {
    display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; padding: 10px 12px; border-radius: 14px; text-decoration: none;
    border: 1px solid color-mix(in srgb, #2F6FB3 30%, var(--line)); background: color-mix(in srgb, #2F6FB3 7%, var(--surface)); color: var(--ink);
  }
  .tr-inv-hint svg { flex: none; color: #2F6FB3; }
  .tr-inv-hint > span { flex: 1 1 auto; min-width: 0; line-height: 1.35; font-size: .86rem; }
  .tr-inv-hint small { color: var(--muted); font-size: .8rem; }
  .tr-inv-hint b { flex: none; color: #2F6FB3; font-size: .84rem; white-space: nowrap; }
  .tr-inv-hint:hover { border-color: #2F6FB3; }
}

/* ---------- จอคอม ---------- */
@media screen and (min-width: 1025px) {
  .tr-fit .fit-body > .tr-main { flex: 1 1 auto; min-height: 0; overflow: hidden; }
}
@media screen and (min-width: 1025px) and (max-width: 1360px) {
  .tr-fit .tr-c-by { display: none; }
  .tr-fit .tr-table td, .tr-fit .tr-table th { padding-left: 8px; padding-right: 8px; }
  .tr-lines .tr-l-no { display: none; }
  .tr-lines .tr-l-hand { width: 140px; }
}
@media screen and (min-width: 761px) and (max-width: 1024px) {
  .tr-fit .tr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-fit .tr-c-by, .tr-fit .tr-c-items { display: none; }
}

/* ---------- มือถือ ---------- */
@media screen and (max-width: 760px) {
  .tr-head-main { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
  .tr-views { display: flex; width: 100%; }
  .tr-views .po-view { flex: 1 1 0; justify-content: center; min-height: 38px; padding: 0 6px; gap: 4px; font-size: .8rem; }
  .tr-views .po-view svg { display: none; }
  .tr-fit .tr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-tab-note { margin: 0 0 8px; border: 0; padding: 0 2px; font-size: .78rem; }

  .tr-fit .tr-table tr.tr-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "route route val" "no date status" "items by act";
    border-left-color: var(--ps, var(--line));
  }
  .tr-fit .tr-table tr.tr-row td { display: block; padding: 0 !important; border: 0; background: none !important; max-width: none; width: auto; min-width: 0; box-shadow: none !important; }
  .tr-fit .tr-table .tr-c-route { grid-area: route; }
  .tr-fit .tr-table .tr-c-val { grid-area: val; font-size: 1.02rem; text-align: right; }
  .tr-fit .tr-table .tr-c-no { grid-area: no; }
  .tr-fit .tr-table .tr-c-no strong { font-size: .8rem; font-weight: 600; color: var(--muted); }
  .tr-fit .tr-table .tr-c-date { grid-area: date; font-size: .76rem; display: flex !important; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .tr-fit .tr-table .tr-c-date > span { display: inline; }
  .tr-fit .tr-table .tr-age { margin-top: 0; }
  .tr-fit .tr-table .tr-c-status { grid-area: status; justify-self: end; }
  .tr-fit .tr-table .tr-c-items { grid-area: items; display: block !important; font-size: .76rem; text-align: left; }
  .tr-fit .tr-table .tr-c-by { grid-area: by; display: block !important; font-size: .76rem; color: var(--muted); max-width: none; }
  .tr-fit .tr-table .tr-c-act { grid-area: act; width: auto; }
  .tr-fit .tr-table .tr-c-act:empty { display: none; }
  .tr-fit .tr-table tr.tr-row:has(.tr-c-act:empty) { grid-template-areas: "route route val" "no date status" "items by by"; }
  .tr-route-b { font-size: .95rem; }

  .tr-d-route { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; }
  .tr-d-line { width: 36px; }
  .tr-d-node { padding: 8px 10px; }

  /* ฟอร์ม */
  .tr-lines thead { display: none; }
  .tr-lines, .tr-lines tbody { display: block; width: 100%; }
  .tr-lines tr.tr-line {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 8px; margin-bottom: 10px; padding: 10px 12px 12px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  }
  .tr-lines tr.tr-line.over { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
  .tr-lines tr.tr-line td { display: block; width: auto !important; min-width: 0 !important; padding: 0 !important; border: 0; background: none; text-align: left; }
  .tr-lines .tr-l-no { display: none !important; }
  .tr-lines .tr-l-prod { grid-column: 1 / 3; grid-row: 1; }
  .tr-lines .tr-l-act { grid-column: 3; grid-row: 1; }
  .tr-lines .tr-l-unit { grid-column: 1; grid-row: 2; }
  .tr-lines .tr-l-qty { grid-column: 2 / 4; grid-row: 2; }
  .tr-lines .tr-l-hand { grid-column: 1 / -1; grid-row: 3; font-size: .8rem; }
  .tr-lines td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: .72rem; }
  .tr-lines .qt-in { font-size: 16px; }
  .tr-ed-mbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 15;
    margin: 0 -16px; padding: 8px 16px 10px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0,0,0,.08);
  }
  .tr-ed-mbar .qt-ed-total { flex: 1 1 100%; flex-direction: row; align-items: baseline; justify-content: space-between; padding: 0; min-width: 0; }
  .tr-ed-mbar .qt-ed-total strong { font-size: 1.15rem; }
  .tr-ed-mbar .btn { flex: 1 1 0; min-height: 46px; }
  .tr-ed-mbar .btn.primary { flex: 2 1 0; }

  /* ป๊อปอัปรับของ */
  .tr-rc-all { margin-left: 0; width: 100%; justify-content: center; min-height: 40px; }
  .tr-rc-list { max-height: none; overflow: visible; }
  .tr-rc-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tr-rc-prod { grid-column: 1 / -1; }
  .tr-rc-got .qt-in { font-size: 16px; }
  .tr-rc-other { font-size: 16px; }
  .tr-rc-foot { margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .tr-rc-sum { flex: 1 1 100%; justify-content: space-between; }
  .tr-rc-foot .actions { flex: 1 1 100%; }
  .tr-rc-foot .actions .btn { flex: 1 1 0; min-height: 48px; }
  .tr-rc-foot .actions .btn.primary { flex: 2 1 0; }

  .tr-inv-hint { flex-wrap: wrap; }
  .tr-inv-hint b { flex: 1 1 100%; text-align: right; }
}

/* ---------- โหมดมืด ---------- */
@media screen {
  html[data-theme="dark"] .ts-sent { --ps: #F0B44C; }
  html[data-theme="dark"] .ts-cancelled { --ps: #8F877F; }
  html[data-theme="dark"] .tr-stat-in.warn { background: color-mix(in srgb, #F0B44C 12%, var(--surface)); box-shadow: var(--shadow), inset 3px 0 0 #F0B44C; }
  html[data-theme="dark"] .tr-stat-in.warn strong { color: #F0B44C; }
  html[data-theme="dark"] .tr-stat-out { box-shadow: var(--shadow), inset 3px 0 0 #8CC4F2; }
  html[data-theme="dark"] .tr-age { background: color-mix(in srgb, #F0B44C 16%, var(--surface)); color: #F5CC80; }
  html[data-theme="dark"] .tr-dir.out { background: color-mix(in srgb, #8CC4F2 14%, var(--surface)); color: #8CC4F2; }
  html[data-theme="dark"] .tr-inv-hint { border-color: color-mix(in srgb, #8CC4F2 30%, var(--line)); background: color-mix(in srgb, #8CC4F2 8%, var(--surface)); }
  html[data-theme="dark"] .tr-inv-hint svg, html[data-theme="dark"] .tr-inv-hint b { color: #8CC4F2; }
  html[data-theme="dark"] .tr-ed-mbar { box-shadow: 0 -6px 18px rgba(0,0,0,.4); }
}

/* ---------- กระดาษใบโอน (บนจอและตอนพิมพ์) ---------- */
.tr-stamp { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.tr-stamp small { font-size: .5em; letter-spacing: .14em; }
.tr-stamp.transit { border-color: #A86A00; color: #A86A00; }
.tr-pparty { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.tr-pbox span { color: #333; }
.tr-pblank { min-height: 1.4em; }
.tr-parrow { align-self: center; color: #555; }
.tr-plines th { white-space: normal !important; vertical-align: bottom; line-height: 1.25; }
.tr-plines .tr-pdesc { overflow-wrap: anywhere; }
.tr-plines .tr-psku { color: #444; font-size: .92em; }
.tr-plines .tr-pgot { min-width: 70px; }
.tr-plines .tr-pshort { color: #B3261E; font-weight: 700; }
.tr-plines .tr-preason { color: #B3261E; font-size: .9em; min-width: 90px; }
.tr-pfoot { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; break-inside: avoid; }
.tr-pnotes { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.tr-psum { flex: none; }
.tr-sign { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tr-sign em { min-height: 1.3em; font-style: normal; font-weight: 600; color: #333; text-align: center; }
.tr-sign span { height: 22px; }
@media screen and (max-width: 760px) {
  .tr-pparty { grid-template-columns: minmax(0, 1fr); }
  .tr-parrow { transform: rotate(90deg); justify-self: center; }
  .tr-plines .tr-psku { display: none; }
  .tr-paper .dbt-lines { font-size: .8em; }
  .tr-plines th, .tr-plines td { padding-left: 3px; padding-right: 3px; }
  .tr-pfoot { flex-direction: column; align-items: stretch; }
  .tr-sign { gap: 10px; }
}

/* =========================== พิมพ์ใบโอน (A4) =========================== */
@page tr-a4 { size: A4; margin: 12mm; }
@media print {
  html[data-print="tr"]:has(.tr-print), html[data-print="tr"]:has(.tr-print) body {
    margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important;
    background: #fff !important; color: #111 !important; page: tr-a4;
  }
  html[data-print="tr"]:has(.tr-print) body *:not(:has(.tr-print)):not(.tr-print):not(.tr-print *) { display: none !important; }
  html[data-print="tr"]:has(.tr-print) body *:has(.tr-print) {
    display: block !important; position: static !important; inset: auto !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    width: auto !important; max-width: none !important; min-width: 0 !important;
    height: auto !important; min-height: 0 !important; max-height: none !important;
    overflow: visible !important; background: none !important; box-shadow: none !important; transform: none !important;
    animation: none !important; zoom: 1 !important;
  }
  html[data-print="tr"] .tr-print, html[data-print="tr"] .tr-print * { visibility: visible !important; }
  html[data-print="tr"] .tr-print { display: block !important; position: static !important; }
  html[data-print="tr"] .tr-paper {
    max-width: none !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important;
    font-size: 10.5pt; gap: 4.5mm;
  }
  html[data-print="tr"] .tr-plines { font-size: 9.5pt; }
  html[data-print="tr"] .tr-plines td { padding-top: 8px; padding-bottom: 8px; }
}
