body{font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:1.35;margin:0;padding:0;background:#f4f6f8;color:#1d2630}
.container{max-width:1200px;margin:16px auto;padding:0 12px 20px}
.card{background:#fff;border:1px solid #dfe5ec;border-radius:6px;padding:16px;box-shadow:0 1px 2px rgba(16,24,40,.06)}
.alert{padding:12px;border-radius:4px;margin-bottom:14px;white-space:pre-wrap}
.alert-danger{background:#ffe8e8;border:1px solid #ffb5b5;color:#9b1c1c}
.xml-raw{background:#0f1720;color:#d7e3ef;padding:14px;border-radius:6px;overflow:auto;max-height:72vh;white-space:pre}
.ksef-x-wrapper{font-size:13px;line-height:1.35}
.ksef-x-wrapper h2,.ksef-x-wrapper h3,.ksef-x-wrapper h4{margin:6px 0 10px;line-height:1.25}
.ksef-x-wrapper h2{font-size:18px}
.ksef-x-wrapper h3{font-size:15px}
.ksef-x-wrapper h4{font-size:13px}
.ksef-meta,.ksef-table{width:100%;border-collapse:collapse;margin:0 0 14px}
.ksef-meta th,.ksef-meta td,.ksef-table th,.ksef-table td{border:1px solid #d8dee6;padding:5px 7px;vertical-align:top}
.ksef-meta th,.ksef-table th{background:#eef3f8;text-align:left}
.ksef-meta tr,.ksef-table tr{transition:background-color .15s ease}
.ksef-meta tr:hover th,.ksef-meta tr:hover td,.ksef-table tr:hover td{background:#edf5ff !important}
.ksef-table tr.ksef-sum-row:hover td{background:#eaf1f8}
.muted{color:#67768a}
.ksef-banner{font-size:20px;font-weight:700;letter-spacing:.02em;margin:0 0 10px}
.ksef-head-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px}
.ksef-head-table{width:100%;table-layout:fixed;border-collapse:collapse;margin:0 0 14px}
.ksef-head-item{border:1px solid #d8dee6;background:linear-gradient(180deg,#f8fafc 0%,#f3f7fb 100%);padding:8px 10px;border-radius:4px;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}
.ksef-head-item:hover{background:#edf5ff;border-color:#c7d8ea;box-shadow:0 1px 3px rgba(28,57,84,.10)}
.ksef-head-label{font-size:10px;color:#67768a;text-transform:uppercase;letter-spacing:.06em;margin-bottom:4px}
.ksef-head-value{font-size:14px;font-weight:700;word-break:break-word}
.ksef-two-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0 0 12px}
.ksef-two-cols-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:12px 0;margin:0 0 12px}
.ksef-two-cols-table td{vertical-align:top}
.ksef-col h3{margin-top:0}
.ksef-summary-amount{text-align:right;font-size:14px;margin:8px 0 16px}
.ksef-adnotacje{border:1px solid #d8dee6;background:#f8fafc;border-radius:4px;padding:8px 10px;margin:0 0 14px}
.ksef-adnotacje div{padding:2px 0}
.ksef-sum-row td{background:#eaf1f8}
.ksef-qr-box{margin-top:16px;padding:14px;border:1px solid #d8dee6;border-radius:6px;background:#f8fafc}
.ksef-qr-title{font-size:16px;font-weight:700;margin:0 0 8px}
.ksef-qr-grid{display:grid;grid-template-columns:220px 1fr;gap:14px;align-items:start}
.ksef-qr-table{width:100%;table-layout:fixed;border-collapse:collapse}
.ksef-qr-cell{vertical-align:top;padding:0}
.ksef-qr-cell-image{width:240px;padding-right:14px}
.ksef-qr-col-title{font-size:13px;font-weight:700;color:#31475c;margin:0 0 6px}
.ksef-qr-image{width:220px;height:220px;border:1px solid #d8dee6;background:#fff;padding:6px;border-radius:4px}
.ksef-qr-note{margin:0 0 6px;color:#4d6074}
.ksef-qr-details div{margin:3px 0;word-break:break-all}
.ksef-qr-link{font-size:11px;color:#4c5f74}
@media screen and (max-width:900px){
  .ksef-head-grid{grid-template-columns:1fr}
  .ksef-two-cols{grid-template-columns:1fr}
  .ksef-qr-grid{grid-template-columns:1fr}
  .ksef-head-table,.ksef-head-table tbody,.ksef-head-table tr,.ksef-head-table td{display:block;width:100% !important}
  .ksef-head-table .ksef-head-item{margin-bottom:8px}
  .ksef-two-cols-table,.ksef-two-cols-table tbody,.ksef-two-cols-table tr,.ksef-two-cols-table td{display:block;width:100% !important}
  .ksef-two-cols-table{border-spacing:0}
  .ksef-qr-table,.ksef-qr-table tbody,.ksef-qr-table tr,.ksef-qr-table td{display:block;width:100% !important}
  .ksef-qr-cell-image{width:100% !important;padding-right:0}
  .ksef-qr-image{width:180px;height:180px}
}
@media print{
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  body{background:#fff;font-size:10px;line-height:1.22;color:#000}
  .container{max-width:none;margin:0;padding:0}
  .card{border:0;box-shadow:none;padding:0}
  .ksef-x-wrapper{font-size:10px;line-height:1.22}
  .ksef-x-wrapper h2,.ksef-x-wrapper h3,.ksef-x-wrapper h4{margin:3px 0 6px;line-height:1.2}
  .ksef-x-wrapper h2{font-size:13px}
  .ksef-x-wrapper h3{font-size:11px}
  .ksef-x-wrapper h4{font-size:10px}
  .ksef-banner{font-size:14px;margin:0 0 6px}
  .ksef-meta,.ksef-table{margin:0 0 7px}
  .ksef-meta th,.ksef-meta td,.ksef-table th,.ksef-table td{padding:2px 4px}
  .ksef-two-cols{display:table;width:100%;table-layout:fixed;border-collapse:separate;border-spacing:6px 0;margin:0 0 8px}
  .ksef-two-cols>.ksef-col{display:table-cell;vertical-align:top}
  .ksef-two-cols-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:6px 0;margin:0 0 8px}
  .ksef-two-cols-table td{vertical-align:top}
  .ksef-col h3{margin:0 0 4px}
  .ksef-summary-amount{font-size:11px;margin:4px 0 8px}
  .ksef-adnotacje{padding:4px 6px;margin:0 0 8px}
  .ksef-adnotacje div{padding:1px 0}
  .ksef-head-grid{display:table;width:100%;table-layout:fixed;border-collapse:collapse;margin:0 0 8px}
  .ksef-head-table{display:table;width:100%;table-layout:fixed;border-collapse:collapse;margin:0 0 8px}
  .ksef-head-item{display:table-cell;border-radius:0;border:1px solid #b6c2cf;background:#edf3f9 !important;box-shadow:none;padding:4px 6px}
  .ksef-head-item + .ksef-head-item{border-left:none}
  .ksef-head-label{color:#4a5b6d;font-size:8px;font-weight:700;letter-spacing:.04em;margin-bottom:2px}
  .ksef-head-value{font-size:10px}
  .ksef-qr-box{margin-top:8px;padding:6px}
  .ksef-qr-table{width:100%;table-layout:fixed;border-collapse:collapse}
  .ksef-qr-cell{vertical-align:top;padding:0}
  .ksef-qr-cell-image{width:150px;padding-right:8px}
  .ksef-qr-col-title{font-size:10px;margin:0 0 3px}
  .ksef-qr-image{width:138px;height:138px;padding:4px}
  .ksef-qr-note{margin:0 0 4px}
  .ksef-qr-details div{margin:1px 0}
  .ksef-qr-link{font-size:9px}
}
