:root {
  --ksef-accent: var(--brand);
  --ksef-accent-dark: var(--brand-dark);
  --ksef-line: #e3e8f0;
  --ksef-muted: #667085;
}

body { background: #f7f8fc; }
.tool-header { border-bottom: 1px solid #edecf2; background: #fff; }
.contact-header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tool-brand img { display: block; width: 145px; height: 64px; object-fit: cover; mix-blend-mode: multiply; }
.back-link { color: #5e55c8; font-size: 13px; font-weight: 700; }
.ksef-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 60px; }
.ksef-eyebrow { margin: 0 0 10px; color: var(--ksef-accent-dark); font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.ksef-shell > h1 { margin: 0; color: #222438; font-size: clamp(30px, 5vw, 42px); letter-spacing: -.045em; line-height: 1.15; }
.ksef-intro { max-width: 800px; margin: 12px 0 25px; color: var(--ksef-muted); font-size: 15px; line-height: 1.7; }
.workspace-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.workspace-nav-group { min-width: 0; padding: 12px; border: 1px solid var(--ksef-line); border-radius: 12px; background: #fff; transition: background .18s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), opacity .18s var(--ease-out); }
.workspace-nav-group h2 { margin: 0 0 8px; color: #292b40; font-size: 13px; }
.workspace-nav-group .ksef-tabs { margin: 0; padding: 0; border: 0; background: transparent; }
.business-tools-group { border-color: #e8e4ff; background: #fff; }
.business-tools-group:has(.ksef-tab[aria-selected="true"]) { border-color: #d7d2ff; box-shadow: 0 3px 12px rgb(var(--brand-rgb) / 5%); }
.test-tools-group { border-color: #e8e4ff; background: #f8f7ff; }
.test-tools-group:has(.ksef-tab[aria-selected="true"]) { border-color: #c9c4fa; background: #fff; box-shadow: 0 4px 16px rgb(var(--brand-rgb) / 8%); }
.workspace-navigation:has(.test-tools-group .ksef-tab[aria-selected="true"]) .business-tools-group { border-color: #e3e5ec; background: #f2f3f7; box-shadow: none; }
.workspace-navigation:has(.test-tools-group .ksef-tab[aria-selected="true"]) .business-tools-group .ksef-tab { color: #626777; background: #f8f9fb; }
.workspace-navigation:has(.business-tools-group .ksef-tab[aria-selected="true"]) .test-tools-group { border-color: #e8e4ff; background: #f8f7ff; }
.ksef-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ksef-tab, .ksef-button { min-height: 40px; padding: 9px 14px; border: 1px solid #dfe3ed; border-radius: 9px; color: #45485a; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; transition: background .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), scale .16s var(--ease-out); }
.ksef-tab[aria-selected="true"] { border-color: #b7b2f3; color: var(--ksef-accent-dark); background: #f6f5ff; }
@media (hover: hover) and (pointer: fine) { .ksef-tab:hover, .ksef-button:hover { border-color: #b7b2f3; color: var(--ksef-accent-dark); background: #f6f5ff; } }
.ksef-panel { display: grid; gap: 14px; }
.ksef-card, .ksef-seo-card, .ksef-faq, .ksef-related { min-width: 0; padding: 21px; border: 1px solid var(--ksef-line); border-radius: 15px; background: #fff; box-shadow: 0 4px 18px rgb(16 24 40 / 4%); }
.ksef-card h2, .ksef-card h3, .ksef-seo h2, .ksef-seo h3 { margin: 0; color: #292b40; letter-spacing: -.025em; }
.ksef-card h2 { font-size: 19px; }
.ksef-card h3 { margin: 22px 0 12px; font-size: 16px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.creator-heading { align-items: flex-start; }
.creator-heading-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.card-description { margin: 5px 0 0; color: var(--ksef-muted); font-size: 12px; line-height: 1.6; }
.drop-zone { position: relative; min-height: 150px; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 20px; border: 1px dashed #b6b9d8; border-radius: 12px; color: #4d5061; background: #fafaff; cursor: pointer; text-align: center; }
.drop-zone.is-dragging { border-color: var(--ksef-accent); background: #f3f2ff; }
@media (hover: hover) and (pointer: fine) { .drop-zone:hover { border-color: var(--ksef-accent); background: #f3f2ff; } }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { font-size: 13px; }
.drop-zone > span:last-child { color: #818596; font-size: 12px; }
.drop-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #5d55c9; background: #f0edff; font-size: 12px; font-weight: 800; }
.paste-box { margin-top: 12px; }
.paste-box summary { width: fit-content; color: var(--ksef-accent-dark); cursor: pointer; font-size: 12px; font-weight: 700; }
.paste-box textarea, .xml-output-label textarea { width: 100%; margin: 10px 0; padding: 12px; border: 1px solid #d7deea; border-radius: 9px; color: #292b40; background: #fdfdff; font: 12px/1.5 Consolas, monospace; resize: vertical; }
.button-row, .quick-copy-list, .bulk-exports, .creator-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.creator-actions { align-items: center; justify-content: space-between; }
.creator-action-group { display: flex; flex-wrap: wrap; gap: 8px; }
.creator-preview-result { margin-top: 14px; padding: 18px; border: 1px solid var(--ksef-line); border-radius: 12px; background: #fafaff; }
.creator-preview-result .card-heading h3 { margin: 0; }
.creator-preview-result .invoice-paper { margin-top: 12px; }
.ksef-primary { border-color: var(--ksef-accent); color: #fff; background: var(--ksef-accent); }
@media (hover: hover) and (pointer: fine) { .ksef-primary:hover { border-color: var(--ksef-accent-dark); color: #fff; background: var(--ksef-accent-dark); } }
.ksef-status, .copy-feedback { min-height: 16px; margin: 8px 0 0; color: #5f6475; font-size: 12px; }
.ksef-status.is-error { color: #b42318; }
.validation-pill, .validation-item { display: inline-flex; align-items: center; gap: 6px; }
.validation-pill { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.validation-pill.ok, .validation-item.ok { color: #087443; background: #e9f8f0; }
.validation-pill.warn, .validation-item.warn { color: #9a5b00; background: #fff5dc; }
.validation-pill.fail, .validation-item.fail { color: #b42318; background: #fff0ed; }
.bulk-issue-trigger { border: 0; cursor: pointer; font: inherit; }
.bulk-issue-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .bulk-issue-trigger:hover { outline: 2px solid currentColor; outline-offset: 2px; } }
.validation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.validation-item { min-height: 35px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.45; }
.bulk-issues-dialog { width: min(620px, calc(100% - 32px)); max-height: min(80vh, 680px); padding: 20px; overflow: auto; border: 1px solid #e3e1f4; border-radius: 14px; color: #292b40; background: #fff; box-shadow: 0 18px 48px rgb(34 31 70 / 24%); }
.bulk-issues-dialog::backdrop { background: rgb(25 24 48 / 48%); }
.bulk-issues-dialog .card-heading { align-items: center; }
.bulk-issues-dialog .card-heading h2 { margin: 0; color: #343095; font-size: 17px; }
.bulk-issues-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.bulk-issues-list .validation-item { display: grid; gap: 4px; }
.bulk-issues-list .validation-item > span { font-weight: 750; }
.bulk-issues-empty { color: #5f6475; font-size: 12px; }
.bulk-issues-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.bulk-totals-summary { display: grid; justify-items: end; gap: 8px; padding: 12px 8px 4px; }
.bulk-total-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; color: #343095; font-size: 12px; font-weight: 700; }
.bulk-total-group > strong { color: #292b40; }
.bulk-total-divider { color: #8d87ef; }
.quick-copy-list .ksef-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.invoice-actions { margin-bottom: 10px; }
.print-option { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; color: #5f6475; font-size: 12px; }
.print-option input, .annotations-grid input, .schema-choice input { accent-color: var(--ksef-accent); }
.invoice-paper { padding: 30px; border: 1px solid #e6e8ed; color: #1c2230; background: #fff; }
.invoice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 2px solid #292b40; }
.invoice-head h2 { margin: 0 0 5px; color: #202338; font-size: 26px; }
.invoice-head p { margin: 3px 0; color: #656b79; font-size: 11px; }
.invoice-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.invoice-meta p { display: grid; gap: 3px; min-width: 105px; margin: 0; padding: 7px 10px; border: 1px solid #e7e5ff; border-radius: 7px; background: #f7f6ff; }
.invoice-meta p span { color: #777b8b; font-size: 9px; }
.invoice-meta p strong { color: #343095; font-size: 11px; }
.invoice-total { min-width: 180px; text-align: right; }
.invoice-total strong { display: block; margin-top: 4px; color: #343095; font-size: 22px; }
.invoice-total small { display: block; margin-top: 5px; color: #656b79; font-size: 9px; line-height: 1.45; }
.invoice-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 18px 0; }
.invoice-additional-party { display: flex; justify-content: center; margin: -8px 0 12px; }
.invoice-additional-party .invoice-party { width: min(100%, 50%); }
.invoice-party { padding: 12px; border: 1px solid #e8eaf0; border-radius: 8px; }
.invoice-party h3, .invoice-section-title { margin: 0 0 8px; color: #343095; font-size: 11px; text-transform: uppercase; }
.invoice-party p { margin: 3px 0; font-size: 11px; line-height: 1.45; }
.invoice-party p:first-of-type { font-weight: 700; }
.invoice-table, .ksef-table { width: 100%; border-collapse: collapse; }
.invoice-table { margin: 10px 0 14px; font-size: 10px; }
.invoice-table th, .invoice-table td { padding: 7px 6px; border: 1px solid #e3e6ec; text-align: left; vertical-align: top; }
.invoice-table th { color: #45485a; background: #f6f7fa; font-weight: 750; }
.invoice-table .numeric { text-align: right; white-space: nowrap; }
.invoice-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .7fr); gap: 20px; margin-top: 18px; }
.tax-summary { width: 100%; border-collapse: collapse; font-size: 10px; }
.tax-summary td, .tax-summary th { padding: 6px; border-bottom: 1px solid #e6e8ed; text-align: right; }
.tax-summary th:first-child, .tax-summary td:first-child { text-align: left; }
.invoice-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.invoice-note { padding: 5px 8px; border-radius: 5px; color: #5545d3; background: #f1efff; font-size: 9px; font-weight: 750; }
.invoice-payment-area { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 16px; }
.invoice-payment { margin-top: 0; padding-top: 12px; border-top: 1px solid #e3e6ec; font-size: 10px; line-height: 1.6; }
.invoice-payment strong { color: #343095; }
.invoice-qr { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px; border: 1px solid #e3e6ec; border-radius: 8px; }
.invoice-qr svg { width: 112px; height: 112px; flex: 0 0 112px; shape-rendering: crispEdges; }
.invoice-qr p { margin: 0; color: #555b68; font-size: 9px; line-height: 1.5; }
.ksef-table { min-width: 1150px; font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
.ksef-table th, .ksef-table td { padding: 8px 7px; border: 1px solid #e5e7ee; text-align: left; vertical-align: top; }
.ksef-table th { color: #45485a; background: #f7f8fb; font-weight: 750; }
.ksef-table td { color: #53596a; line-height: 1.45; }
.ksef-table tfoot td { color: #292b40; background: #fafaff; font-weight: 750; }
.table-action { display: grid; gap: 5px; }
.table-action .ksef-button { min-height: 30px; padding: 5px 7px; font-size: 12px; }
.bulk-exports { margin-top: 14px; }
.test-only-action[hidden], .test-only-actions[hidden] { display: none; }
.creator-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #e8e9f2; border-radius: 10px; background: #fafaff; }
.schema-choice { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; border: 0; color: #45485a; font-size: 12px; }
.schema-choice legend { margin-bottom: 7px; font-weight: 750; }
.schema-choice label, .annotations-grid label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.creator-calculation-options { margin: 14px 0 10px; padding: 12px; border: 1px solid #e5e2fb; border-radius: 10px; background: #fbfaff; }
.creator-calculation-options > legend { padding: 0 5px; color: #343095; font-size: 12px; font-weight: 750; }
.creator-calculation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.creator-calculation-grid .schema-choice { align-content: start; gap: 8px; }
.creator-calculation-grid .schema-choice label { align-items: flex-start; line-height: 1.5; }
.creator-calculation-help { margin: 10px 0 0; color: #667085; font-size: 12px; line-height: 1.55; }
.creator-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.party-card { min-width: 0; display: grid; align-content: start; gap: 10px; margin: 0; padding: 14px; border: 1px solid #e3e8f0; border-radius: 10px; }
.party-card legend { padding: 0 5px; color: #343095; font-size: 12px; font-weight: 750; }
.ksef-field { min-width: 0; display: grid; gap: 6px; color: #45485a; font-size: 12px; font-weight: 700; }
.ksef-field input, .ksef-field select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #d7deea; border-radius: 8px; color: #292b40; background: #fdfdff; font: inherit; font-size: 12px; }
.vat-prefix-control { position: relative; display: block; min-width: 0; }
.vat-prefix-toggle { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #d7deea; border-radius: 8px; color: #292b40; background: #fdfdff; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.vat-prefix-toggle:focus-visible, .vat-prefix-toggle[aria-expanded="true"] { outline: 2px solid rgb(var(--brand-rgb) / 13%); border-color: #a5a6f6; }
@media (hover: hover) and (pointer: fine) { .vat-prefix-toggle:hover { outline: 2px solid rgb(var(--brand-rgb) / 13%); border-color: #a5a6f6; } }
.vat-prefix-toggle:disabled { color: #8a8d9b; background: #f5f5f8; cursor: not-allowed; }
.line-prefix-options[popover] { max-width: min(220px, calc(100vw - 16px)); max-height: 124px; }
.ksef-field input:focus, .ksef-field select:focus, .paste-box textarea:focus, .xml-output-label textarea:focus { outline: 3px solid rgb(var(--brand-rgb) / 13%); border-color: #a5a6f6; }
.ksef-date-field { position: relative; display: block; min-width: 0; }
.ksef-date-input-wrap { display: flex; }
.ksef-date-input-wrap input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ksef-date-toggle { min-width: 42px; border: 1px solid #d7deea; border-left: 0; border-radius: 0 8px 8px 0; color: var(--ksef-accent-dark); background: #f5f4ff; cursor: pointer; font-size: 18px; }
.ksef-date-toggle[aria-expanded="true"] { color: #fff; background: var(--ksef-accent); }
@media (hover: hover) and (pointer: fine) { .ksef-date-toggle:hover { color: #fff; background: var(--ksef-accent); } }
.ksef-date-popover { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; width: min(320px, calc(100vw - 48px)); padding: 12px; border: 1px solid #e3e1f4; border-radius: 14px; background: #fff; box-shadow: 0 14px 36px rgb(34 31 70 / 18%); color: #34364a; font-size: 12px; font-weight: 400; }
.ksef-date-popover[hidden] { display: none; }
.ksef-date-picker-header { display: grid; grid-template-columns: 32px minmax(0, 1fr) 68px 32px; align-items: center; gap: 6px; }
.ksef-date-picker-header select, .ksef-date-picker-header input { width: 100%; min-width: 0; height: 34px; padding: 0 7px; border: 1px solid #e1e3ed; border-radius: 8px; color: #292b40; background: #fbfbff; font: inherit; font-size: 12px; font-weight: 700; }
.ksef-date-picker-header input { text-align: center; }
.ksef-date-nav { width: 32px; height: 32px; padding: 0; border: 1px solid #e5e4f2; border-radius: 8px; color: var(--ksef-accent-dark); background: #f7f6ff; cursor: pointer; font-size: 22px; line-height: 1; }
@media (hover: hover) and (pointer: fine) { .ksef-date-nav:hover { color: #fff; background: var(--ksef-accent); } }
.ksef-date-error { margin: 5px 0; color: #b42318; font-size: 12px; }
.ksef-date-weekdays, .ksef-date-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ksef-date-weekdays { margin: 10px 0 5px; color: #667085; text-align: center; font-size: 12px; font-weight: 700; }
.ksef-date-weekdays span { padding: 4px 0; }
.ksef-date-day-empty, .ksef-date-day { min-width: 0; height: 34px; display: grid; place-items: center; }
.ksef-date-day { padding: 0; border: 1px solid transparent; border-radius: 9px; color: #34364a; background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
@media (hover: hover) and (pointer: fine) { .ksef-date-day:hover { border-color: #c9c5fa; color: var(--ksef-accent-dark); background: #f5f3ff; } }
.ksef-date-day.is-selected { border-color: var(--ksef-accent); color: #fff; background: var(--ksef-accent); }
.ksef-date-day.is-today:not(.is-selected) { border-color: #8d87ef; color: var(--ksef-accent-dark); font-weight: 800; }
.ksef-date-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #eff0f5; }
.ksef-date-footer button { min-height: 29px; padding: 0 8px; border: 1px solid #e6e5f1; border-radius: 7px; color: #4b4d60; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .ksef-date-footer button:hover { border-color: #c4c0f5; color: var(--ksef-accent-dark); background: #f7f6ff; } }
.ksef-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.inline-input { display: flex; align-items: center; gap: 6px; }
.small-button { min-height: 34px; padding: 6px 9px; font-size: 12px; white-space: nowrap; }
.field-status { min-height: 13px; color: #667085; font-size: 12px; font-weight: 500; }
.field-status.is-ok { color: #087443; }
.field-status.is-error { color: #b42318; }
.line-items-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.line-items-heading h3 { margin-bottom: 0; }
.creator-lines-wrap { margin-top: 10px; }
.creator-lines { width: 100%; min-width: 920px; table-layout: fixed; background: #fcfbff; }
.creator-lines th, .creator-lines td { padding: 6px 3px; border-color: #e7e3f7; font-size: 11px; }
.creator-lines th { color: #46406f; background: #f3f1fc; line-height: 1.25; }
.creator-lines tbody tr:nth-child(even) td { background: #f8f6ff; }
.creator-lines tbody td:nth-child(8), .creator-lines tbody td:nth-child(9), .creator-lines tbody td:nth-child(10) { color: #40397a; }
.creator-lines th:nth-child(1), .creator-lines td:nth-child(1) { width: 5%; text-align: center; }
.creator-lines th:nth-child(2), .creator-lines td:nth-child(2) { width: 20%; }
.creator-lines th:nth-child(3), .creator-lines td:nth-child(3) { width: 7.5%; }
.creator-lines th:nth-child(4), .creator-lines td:nth-child(4) { width: 8%; }
.creator-lines th:nth-child(5), .creator-lines td:nth-child(5) { width: 8.5%; }
.creator-lines th:nth-child(6), .creator-lines td:nth-child(6) { width: 7.5%; }
.creator-lines th:nth-child(7), .creator-lines td:nth-child(7) { width: 12%; }
.creator-lines th:nth-child(8), .creator-lines td:nth-child(8),
.creator-lines th:nth-child(9), .creator-lines td:nth-child(9),
.creator-lines th:nth-child(10), .creator-lines td:nth-child(10) { width: 9%; }
.creator-lines th:nth-child(11), .creator-lines td:nth-child(11) { width: 4.5%; }
.creator-lines input, .creator-lines select { width: 100%; min-width: 0; min-height: 32px; padding: 4px 3px; border: 1px solid #d7deea; border-radius: 6px; font: inherit; font-size: 11px; }
.line-unit-control, .line-rate-control { position: relative; display: block; min-width: 0; }
.creator-lines .line-unit-control > input, .creator-lines .line-rate-toggle { border-color: #ddd9f0; background: #fff; }
.creator-lines .line-unit-control > input:focus, .creator-lines .line-rate-toggle:focus { outline: 2px solid rgb(var(--brand-rgb) / 16%); border-color: #b7b2f3; }
.creator-lines .line-rate-toggle { width: 100%; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 3px; padding: 4px 3px; border: 1px solid #d7deea; border-radius: 6px; color: #45485a; cursor: pointer; font: inherit; font-size: 11px; line-height: 1.2; text-align: left; }
.line-rate-chevron { width: 6px; height: 6px; flex: 0 0 6px; transform: translateY(-2px) rotate(45deg); border-right: 1.5px solid #77728f; border-bottom: 1.5px solid #77728f; }
.line-dropdown[popover] { position: fixed; inset: auto; z-index: 20; width: max-content; max-width: min(240px, calc(100vw - 16px)); max-height: 128px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 4px; border: 1px solid #dedaf2; border-radius: 8px; color: #45485a; background: #fff; box-shadow: 0 8px 22px rgb(42 35 91 / 14%); }
.line-dropdown button { width: 100%; min-height: 29px; display: block; padding: 5px 7px; border: 0; border-radius: 5px; color: inherit; background: transparent; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.25; text-align: left; white-space: nowrap; }
.line-dropdown button:focus, .line-dropdown button[aria-selected="true"] { outline: 0; color: #4338a5; background: #f2f0fc; }
@media (hover: hover) and (pointer: fine) { .line-dropdown button:hover { outline: 0; color: #4338a5; background: #f2f0fc; } }
.line-unit-options[popover] { max-width: min(180px, calc(100vw - 16px)); }
.line-delete-button { width: 30px; min-height: 30px; display: grid; place-items: center; margin: auto; padding: 5px; border-color: #f0c7c3; color: #b42318; }
@media (hover: hover) and (pointer: fine) { .line-delete-button:hover { border-color: #b42318; color: #b42318; background: #fff0ed; } }
.line-delete-button svg { width: 17px; height: 17px; }
.creator-advanced > summary, .line-code-fields > summary { position: relative; width: fit-content; padding-right: 20px; color: var(--ksef-accent-dark); cursor: pointer; font-weight: 700; list-style: none; }
.creator-advanced > summary::-webkit-details-marker, .line-code-fields > summary::-webkit-details-marker { display: none; }
.creator-advanced > summary::after, .line-code-fields > summary::after { position: absolute; top: 50%; right: 4px; width: 7px; height: 7px; transform: translateY(-70%) rotate(45deg); border-right: 2px solid var(--ksef-accent); border-bottom: 2px solid var(--ksef-accent); content: ""; transition: transform .18s var(--ease-out); }
.creator-advanced[open] > summary::after, .line-code-fields[open] > summary::after { transform: translateY(-30%) rotate(225deg); }
.line-code-fields { margin-top: 6px; color: #5e6274; font-size: 12px; }
.line-code-fields div { display: grid; grid-template-columns: repeat(2, minmax(100px, 1fr)); gap: 5px; min-width: 235px; padding: 6px 0; }
.creator-lines .line-percent-control { display: flex; min-width: 0; align-items: center; gap: 3px; }
.creator-lines .line-percent-control input { flex: 1 1 0; width: 0; }
.creator-lines .line-percent-control > span { flex: 0 0 auto; padding-right: 3px; color: #77719a; font-size: 11px; }
.creator-lines input[data-field="ossRate"] { margin-top: 5px; }
.creator-totals { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: flex-end; padding: 12px; color: #45485a; font-size: 12px; }
.creator-totals strong { color: #292b40; }
.annotations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 15px; padding: 13px; border: 1px solid #e8e9f2; border-radius: 9px; }
.annotations-grid .exemption-option { align-items: flex-start; flex-wrap: wrap; }
.exemption-option input[name="exemptionBasis"] { flex: 1 1 100%; margin-left: 22px; }
.xml-output-label { margin-top: 12px; }
.ksef-seo { display: grid; gap: 13px; margin-top: 30px; }
.ksef-seo-intro { padding: 0 2px 6px; }
.ksef-seo h2 { margin-bottom: 13px; color: #25283b; font-size: clamp(23px, 3.5vw, 30px); line-height: 1.25; }
.ksef-seo h3 { margin-bottom: 10px; font-size: 17px; }
.ksef-seo p, .ksef-seo li { color: #606577; font-size: 12px; line-height: 1.75; }
.ksef-seo p { margin-bottom: 10px; }
.ksef-seo ul { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 20px; }
.ksef-faq details { border-top: 1px solid #eceef3; }
.ksef-faq details:first-of-type { border-top: 0; }
.ksef-faq summary { position: relative; padding: 13px 28px 13px 0; color: #383b50; cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; }
.ksef-faq summary::-webkit-details-marker { display: none; }
.ksef-faq summary::after { position: absolute; top: 11px; right: 3px; color: #6258d1; content: "⌄"; font-size: 18px; transition: transform .18s var(--ease-out); }
.ksef-faq details[open] summary::after { transform: rotate(180deg); }
.ksef-faq details p { margin: 0 0 13px; }
.ksef-seo a, .ksef-faq a { color: #5146c8; text-decoration: underline; text-decoration-color: #c9c4fa; text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .ksef-seo a:hover, .ksef-faq a:hover { color: #3930b4; text-decoration-color: currentColor; } }
.ksef-external-link { white-space: nowrap; }
.ksef-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ksef-related-card { min-height: 175px; display: flex; flex-direction: column; align-items: flex-start; padding: 16px; border: 1px solid #eaebf1; border-radius: 13px; color: #292b40; background: #fff; text-decoration: none; box-shadow: 0 3px 10px rgb(28 33 66 / 2%); transition: transform .2s var(--ease-out), border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), scale .16s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ksef-related-card:hover { transform: translateY(-3px); border-color: #d9d3ff; box-shadow: 0 10px 24px rgb(54 45 112 / 8%); } }
.ksef-related-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 11px; font-size: 15px; font-weight: 750; }
.ksef-related-icon.violet { color: #695ade; background: #f0edff; }
.ksef-related-icon.blue { color: #4384d9; background: #eaf3ff; }
.ksef-related-icon.mint { color: #299d7b; background: #e9f8f2; }
.related-category { color: #5e55c8; font-size: 11px; font-weight: 750; text-transform: uppercase; }
.ksef-related-card strong { margin-bottom: 6px; color: #292b40; font-size: 14px; line-height: 1.4; }
.ksef-related-description { color: #5f6475; font-size: 13px; line-height: 1.6; }
.ksef-back-to-tool { position: fixed; z-index: 4; right: max(20px, calc((100vw - 1120px) / 2)); bottom: 20px; display: none; padding: 12px 15px; border-radius: 10px; color: #fff; background: var(--brand); box-shadow: 0 8px 22px rgb(41 34 119 / 22%); font-size: 12px; font-weight: 750; transition: scale .16s var(--ease-out); }
.ksef-back-to-tool.is-visible { display: inline-flex; }
.support-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding: 14px 16px; border: 1px solid #e5e0ff; border-radius: 12px; color: #4e477f; background: #f8f7ff; font-size: 13px; line-height: 1.5; }
.support-banner p { display: flex; align-items: center; gap: 8px; margin: 0; }
.support-icon { font-size: 18px; }
.support-banner a { min-height: 38px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0 14px; border-radius: 8px; color: #fff; background: var(--ksef-accent-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .support-banner a:hover { background: #3930b4; } }

@media (max-width: 760px) {
  .ksef-shell { width: min(100% - 28px, 1120px); padding-top: 30px; }
  .workspace-navigation { grid-template-columns: 1fr; }
  .ksef-tabs { display: grid; grid-template-columns: 1fr; }
  .ksef-tab { text-align: left; }
  .validation-list, .creator-grid, .party-grid, .annotations-grid { grid-template-columns: 1fr; }
  .creator-calculation-grid { grid-template-columns: 1fr; }
  .invoice-paper { padding: 16px; }
  .invoice-head, .invoice-bottom { grid-template-columns: 1fr; display: grid; }
  .invoice-total { text-align: left; }
  .invoice-parties { grid-template-columns: 1fr; }
  .invoice-table { min-width: 680px; }
  .invoice-table-wrap { overflow-x: auto; }
  .ksef-related-grid { grid-template-columns: 1fr; gap: 10px; }
  .ksef-related-card { min-height: 0; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; align-items: center; }
  .ksef-related-icon { grid-row: span 3; margin: 0; }
  .ksef-related-card .related-category, .ksef-related-card strong { margin: 0; }
  .card-heading, .line-items-heading { align-items: flex-start; }
  .creator-heading { flex-direction: column; }
  .creator-heading-actions { justify-content: flex-start; }
  .creator-toolbar { align-items: flex-start; }
  .ksef-card { padding: 16px; }
  .support-banner { align-items: stretch; flex-direction: column; gap: 10px; }
  .support-banner a { align-self: flex-start; }
}

@page {
  size: A4;
  margin: 8mm 8mm 16mm;
  @top-left { content: none; }
  @top-center { content: none; }
  @top-right { content: none; }
  @bottom-left { content: none; }
  @bottom-center {
    content: "Kreator Faktur KSeF | WuseBox.com";
    color: var(--brand-dark);
    font: 700 8pt Arial, sans-serif;
  }
  @bottom-right {
    content: counter(page) "/" counter(pages);
    color: #667085;
    font: 8pt Arial, sans-serif;
  }
}
@media print {
  html, body { width: auto; min-width: 0; margin: 0; padding: 0; background: #fff !important; }
  body * { visibility: hidden !important; }
  #invoice-card, #invoice-card * { visibility: visible !important; }
  #invoice-card { position: absolute; inset: 0; width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
  #invoice-card > :not(.invoice-paper) { display: none !important; }
  body.is-printing-invoice > * { display: none !important; }
  body.is-printing-invoice .ksef-shell { display: block !important; width: auto; margin: 0; padding: 0; }
  body.is-printing-invoice .ksef-shell > * { display: none !important; }
  body.is-printing-invoice #panel-view { display: block !important; }
  body.is-printing-invoice #panel-view > * { display: none !important; }
  body.is-printing-invoice #invoice-card { position: static; display: block !important; width: 100%; }
  body.is-printing-invoice #invoice-paper { display: block !important; }
  body.is-printing-creator > * { display: none !important; }
  body.is-printing-creator .ksef-shell { display: block !important; width: auto; margin: 0; padding: 0; }
  body.is-printing-creator .ksef-shell > * { display: none !important; }
  body.is-printing-creator #panel-create { display: block !important; }
  body.is-printing-creator #panel-create > * { display: none !important; }
  body.is-printing-creator #creator-form { display: block !important; }
  body.is-printing-creator #creator-form > * { display: none !important; }
  body.is-printing-creator #invoice-card, body.is-printing-creator #invoice-card * { display: none !important; }
  body.is-printing-creator #creator-preview-result, body.is-printing-creator #creator-preview-result * { visibility: visible !important; }
  body.is-printing-creator #creator-preview-result { position: static; display: block !important; width: 100%; margin: 0; padding: 0; border: 0; background: #fff; }
  body.is-printing-creator #creator-preview-result > :not(.invoice-paper) { display: none !important; }
  body.is-printing-creator #creator-preview-result .invoice-paper { width: 100%; margin: 0; padding: 0; border: 0; }
  body.is-printing-bulk #invoice-card, body.is-printing-bulk #invoice-card * { visibility: hidden !important; }
  body.is-printing-bulk #bulk-print-paper, body.is-printing-bulk #bulk-print-paper * { visibility: visible !important; }
  body.is-printing-bulk #bulk-print-paper { position: absolute; inset: 0; display: block !important; width: 100%; }
  .invoice-paper { box-sizing: border-box; width: 100%; padding: 0; border: 0; font-size: 8pt; }
  .invoice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom-color: var(--brand); }
  .invoice-head > div:first-child { min-width: 0; flex: 1 1 auto; }
  .invoice-head h2 { color: #343095; font-size: 17px; }
  .invoice-head p { font-size: 8px; }
  .invoice-total { min-width: 125px; flex: 0 0 125px; margin-left: auto; text-align: right; }
  .invoice-total strong { color: var(--brand-dark); font-size: 16px; }
  .invoice-total small { margin-top: 2px; font-size: 7px; }
  .invoice-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 7px 0; }
  .invoice-party { padding: 6px; border-color: #e7e5ff; }
  .invoice-party h3, .invoice-section-title { margin-bottom: 3px; color: var(--brand-dark); font-size: 8px; }
  .invoice-party p { margin: 1px 0; font-size: 7px; line-height: 1.2; }
  .invoice-additional-party { margin: 0 0 6px; }
  .invoice-additional-party .invoice-party { width: 50%; }
  .invoice-meta { gap: 4px; margin-top: 5px; }
  .invoice-meta p { min-width: 80px; padding: 3px 5px; border-color: #e7e5ff; background: #f7f6ff !important; }
  .invoice-meta p span { font-size: 6px; }
  .invoice-meta p strong { font-size: 7px; }
  .bulk-invoice-paper { page-break-after: always; break-after: page; }
  .bulk-invoice-paper:last-child { page-break-after: auto; break-after: auto; }
  .invoice-table-wrap { overflow: visible; }
  .invoice-table { margin: 5px 0 6px; table-layout: fixed; font-size: 6pt; }
  .invoice-table th, .invoice-table td { padding: 2px; overflow-wrap: anywhere; }
  .invoice-table .numeric { white-space: normal; }
  .invoice-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr); gap: 10px; margin-top: 6px; }
  .tax-summary { font-size: 7px; }
  .tax-summary td, .tax-summary th { padding: 3px; }
  .invoice-notes { gap: 3px; margin-top: 5px; }
  .invoice-note { padding: 2px 4px; font-size: 6px; }
  .invoice-payment-area { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 7px; }
  .invoice-payment { padding-top: 5px; font-size: 7px; line-height: 1.35; }
  .invoice-qr { flex-direction: column; gap: 3px; padding: 4px; }
  .invoice-qr svg { width: 70px; height: 70px; flex-basis: 70px; }
  .invoice-qr p { max-width: 86px; font-size: 6px; line-height: 1.2; text-align: center; }
  .invoice-payment-area > .ksef-status { margin: 0; font-size: 7px; }
  .invoice-qr[hidden] { display: none !important; }
  .invoice-head, .invoice-parties, .invoice-additional-party, .invoice-bottom, .invoice-payment-area { break-inside: avoid; }
}
