/* Toolxora Document Tools v9 - isolated styles */
.txdoc-tool,.txdoc-tool *{box-sizing:border-box}
.txdoc-tool{font-family:Inter,Arial,sans-serif;color:#0f172a;background:linear-gradient(180deg,#fff,#f8fbff);border-radius:28px}
.txdoc-tool.txdoc-dark{color:#f8fafc;background:#020617}
.txdoc-top{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:28px;background:#fff;border:1px solid #e5e7eb;border-radius:26px;box-shadow:0 20px 60px rgba(15,23,42,.08);margin-bottom:22px}
.txdoc-dark .txdoc-top,.txdoc-dark .txdoc-control,.txdoc-dark .txdoc-panel,.txdoc-dark .txdoc-preview-panel{background:#0f172a;border-color:#1e293b}
.txdoc-kicker{display:inline-flex;color:#2563eb;font-size:13px;font-weight:900;background:rgba(37,99,235,.10);padding:8px 12px;border-radius:999px;margin-bottom:10px}
.txdoc-top h2{margin:0 0 8px;font-size:clamp(26px,4vw,40px);letter-spacing:-.045em}
.txdoc-top p{color:#64748b;margin:0}.txdoc-actions,.txdoc-control{display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.txdoc-control{background:#fff;border:1px solid #e5e7eb;border-radius:22px;padding:18px;box-shadow:0 20px 60px rgba(15,23,42,.08);margin-bottom:22px}
.txdoc-primary-btn,.txdoc-secondary-btn,.txdoc-light-btn,.txdoc-danger-btn,.txdoc-icon-btn{border:0;border-radius:14px;padding:13px 18px;font-weight:900;cursor:pointer;transition:.2s ease;white-space:nowrap;font-family:inherit}
.txdoc-primary-btn{color:#fff!important;background:linear-gradient(135deg,#2563eb,#7c3aed)!important;box-shadow:0 16px 34px rgba(37,99,235,.24)!important}
.txdoc-secondary-btn{background:#0f172a!important;color:#fff!important}
.txdoc-light-btn,.txdoc-icon-btn{background:#f8fafc!important;color:#0f172a!important;border:1px solid #e5e7eb!important}
.txdoc-danger-btn{background:#fee2e2!important;color:#dc2626!important}
.txdoc-primary-btn:hover,.txdoc-secondary-btn:hover,.txdoc-light-btn:hover,.txdoc-icon-btn:hover{transform:translateY(-2px)}
.txdoc-grid{display:grid;grid-template-columns:.95fr 1.05fr;gap:24px;align-items:start}
.txdoc-panel,.txdoc-preview-panel{background:#fff;border:1px solid #e5e7eb;border-radius:26px;box-shadow:0 20px 60px rgba(15,23,42,.08);padding:24px}
.txdoc-preview-panel{position:sticky;top:96px}
.txdoc-section-title{display:flex;gap:14px;align-items:flex-start;margin-bottom:20px}.txdoc-section-title span{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-size:13px;font-weight:900}.txdoc-section-title h3{margin:0;font-size:22px;letter-spacing:-.025em}.txdoc-section-title p{margin:4px 0 0;color:#64748b}.txdoc-small-title{margin-top:28px}
.txdoc-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.txdoc-field{min-width:160px}.txdoc-field label{display:block;font-weight:900;font-size:13px;margin-bottom:8px;color:inherit}
.txdoc-field input,.txdoc-field select,.txdoc-field textarea{width:100%;border:1px solid #e5e7eb;background:#f8fafc;color:#0f172a;border-radius:14px;padding:13px 15px;font-size:14px;outline:none;transition:.18s ease;font-family:inherit}
.txdoc-field select{appearance:auto!important;-webkit-appearance:menulist!important;background:#f8fafc!important}
.txdoc-field textarea{min-height:92px;resize:vertical}
.txdoc-field input:focus,.txdoc-field select:focus,.txdoc-field textarea:focus{border-color:#2563eb;background:#fff;box-shadow:0 0 0 4px rgba(37,99,235,.12)}
.txdoc-template-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.txdoc-template-card{border:2px solid #e5e7eb;background:#fff;color:#0f172a;border-radius:18px;padding:12px;cursor:pointer;text-align:left;transition:.2s ease;font-family:inherit}
.txdoc-template-card:hover{transform:translateY(-3px);box-shadow:0 20px 60px rgba(15,23,42,.08)}
.txdoc-template-card.is-active{border-color:#2563eb!important;box-shadow:0 0 0 4px rgba(37,99,235,.12)!important}
.txdoc-template-card strong,.txdoc-template-card small{display:block}.txdoc-template-card strong{margin-top:10px;font-size:14px}.txdoc-template-card small{color:#64748b;margin-top:3px}
.txdoc-template-thumb{display:block;height:58px;border-radius:12px;background:#f1f5f9;border:1px solid #e5e7eb;position:relative;overflow:hidden}
.txdoc-template-thumb:before,.txdoc-template-thumb:after{content:"";position:absolute;left:10px;right:10px;height:7px;border-radius:999px;background:#cbd5e1}.txdoc-template-thumb:before{top:13px}.txdoc-template-thumb:after{top:28px;width:60%}
.txdoc-template-thumb.modern{background:linear-gradient(135deg,#eff6ff,#f8fafc);border-top:5px solid #2563eb}.txdoc-template-thumb.corporate{background:#eff6ff;border-left:7px solid #1e3a8a}.txdoc-template-thumb.minimal{background:#fff;border:1px solid #111827}.txdoc-template-thumb.elegant{background:linear-gradient(135deg,#faf5ff,#fff7ed);border-top:5px solid #7c3aed}
.txdoc-upload{display:block;border:2px dashed #93c5fd;background:rgba(37,99,235,.08);color:#2563eb;text-align:center;padding:22px;border-radius:18px;cursor:pointer;margin-bottom:18px}.txdoc-upload input{display:none}.txdoc-upload strong,.txdoc-upload span{display:block}.txdoc-upload span{margin-top:5px;font-size:13px}
.txdoc-items{border:1px solid #e5e7eb;border-radius:18px;overflow:hidden;margin-bottom:14px}.txdoc-item-row{display:grid;grid-template-columns:1.6fr .55fr .75fr 44px;gap:10px;padding:12px;border-bottom:1px solid #e5e7eb}.txdoc-item-head{background:#0f172a;color:#fff;font-weight:900;font-size:13px}.txdoc-item-row input{width:100%;border:1px solid #e5e7eb;border-radius:12px;padding:11px 12px;background:#fff;color:#0f172a}.txdoc-remove-btn{border:0;background:#ef4444!important;color:#fff!important;border-radius:10px;font-size:18px;cursor:pointer}
.txdoc-full,.txdoc-bottom-print{width:100%;justify-content:center;margin-bottom:18px}.txdoc-bottom-print{margin-top:22px;margin-bottom:0;font-size:16px;padding:16px 20px}
.txdoc-preview-actions{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.txdoc-preview-actions span{background:rgba(37,99,235,.10);color:#2563eb;padding:7px 11px;border-radius:999px;font-weight:900;font-size:12px}
.txdoc-paper{background:#fff;color:#111827;border:1px solid #e5e7eb;border-radius:22px;padding:36px;min-height:760px;overflow:hidden;position:relative}.txdoc-preview-logo{display:none;max-width:150px;max-height:72px;object-fit:contain;margin-bottom:14px}.txdoc-doc-top{display:flex;justify-content:space-between;gap:28px;padding-bottom:24px;margin-bottom:26px}.txdoc-doc-top h2,.txdoc-doc-meta h1{margin:0}.txdoc-doc-top h2{font-size:26px;letter-spacing:-.03em}.txdoc-doc-top p,.txdoc-doc-meta p{color:#64748b;margin:7px 0 0}.txdoc-doc-meta{text-align:right;min-width:190px}.txdoc-doc-meta h1{font-size:38px;letter-spacing:2px}
.txdoc-status{display:inline-block;margin-top:12px;padding:8px 14px;border-radius:999px;font-weight:900;font-size:12px;text-transform:uppercase;background:#e0f2fe;color:#0369a1}.txdoc-status.paid,.txdoc-status.accepted,.txdoc-status.approved,.txdoc-status.completed{background:#dcfce7;color:#16a34a}.txdoc-status.refunded{background:#fee2e2;color:#dc2626}.txdoc-status.partial,.txdoc-status.sent,.txdoc-status.issued{background:#fef3c7;color:#d97706}
.txdoc-client-box{padding:18px;margin-bottom:24px}.txdoc-client-box span{color:#64748b;font-weight:900;font-size:12px;text-transform:uppercase}.txdoc-client-box h3{margin:7px 0 5px;font-size:22px}.txdoc-client-box p{margin:5px 0;color:#475569}
.txdoc-preview-table{width:100%;border-collapse:collapse}.txdoc-preview-table th{color:#fff;padding:13px;text-align:left;font-size:13px}.txdoc-preview-table td{padding:14px 13px;border-bottom:1px solid #e5e7eb;color:#374151}
.txdoc-doc-bottom{display:grid;grid-template-columns:1fr 300px;gap:26px;margin-top:28px}.txdoc-doc-bottom h4{margin:0 0 8px;font-size:15px}.txdoc-doc-bottom p{color:#475569;line-height:1.6}.txdoc-total-box{border-radius:18px;padding:20px}.txdoc-total-box p,.txdoc-total-box h3{display:flex;justify-content:space-between;gap:14px;margin:0 0 13px}.txdoc-total-box h3{padding-top:15px;margin-top:4px;font-size:22px}.txdoc-powered{margin-top:26px;text-align:center;color:#94a3b8;font-size:12px}
.txdoc-template-modern .txdoc-doc-top{border-bottom:3px solid #111827}.txdoc-template-modern .txdoc-client-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px}.txdoc-template-modern .txdoc-preview-table th{background:#111827}.txdoc-template-modern .txdoc-total-box{background:#f8fafc;border:1px solid #e5e7eb}.txdoc-template-modern .txdoc-total-box h3{border-top:1px solid #d1d5db}
.txdoc-template-corporate{border-radius:0;padding:0;border:0}.txdoc-template-corporate .txdoc-template-mark{height:18px;background:#1e3a8a}.txdoc-template-corporate .txdoc-doc-top{background:#eff6ff;padding:34px 36px;margin:0;border-bottom:0}.txdoc-template-corporate .txdoc-doc-meta{background:#1e3a8a;color:#fff;padding:22px;border-radius:16px}.txdoc-template-corporate .txdoc-doc-meta h1,.txdoc-template-corporate .txdoc-doc-meta p,.txdoc-template-corporate .txdoc-doc-meta strong,.txdoc-template-corporate .txdoc-doc-meta span{color:#fff}.txdoc-template-corporate .txdoc-client-box{margin:26px 36px;background:#fff;border-left:5px solid #1e3a8a;border-radius:0;box-shadow:0 8px 28px rgba(30,58,138,.08)}.txdoc-template-corporate .txdoc-preview-table{width:calc(100% - 72px);margin:0 36px}.txdoc-template-corporate .txdoc-preview-table th{background:#1e3a8a}.txdoc-template-corporate .txdoc-doc-bottom{margin:28px 36px 0}.txdoc-template-corporate .txdoc-total-box{background:#eff6ff;border:1px solid #bfdbfe;border-radius:12px}.txdoc-template-corporate .txdoc-total-box h3{border-top:2px solid #1e3a8a}
.txdoc-template-minimal{border-radius:0;border:1px solid #111827;padding:42px}.txdoc-template-minimal .txdoc-doc-top{border-bottom:1px solid #111827}.txdoc-template-minimal .txdoc-doc-meta h1{font-size:30px;letter-spacing:0}.txdoc-template-minimal .txdoc-client-box{padding:0 0 20px;border-bottom:1px solid #e5e7eb}.txdoc-template-minimal .txdoc-preview-table th{background:transparent;color:#111827;border-bottom:1px solid #111827;padding-left:0}.txdoc-template-minimal .txdoc-preview-table td{padding-left:0}.txdoc-template-minimal .txdoc-total-box{background:transparent;border:0;padding:0}.txdoc-template-minimal .txdoc-total-box h3{border-top:1px solid #111827}
.txdoc-template-elegant{background:linear-gradient(180deg,#fff,#faf7ff);border:1px solid #ddd6fe}.txdoc-template-elegant .txdoc-doc-top{border-bottom:3px solid #7c3aed}.txdoc-template-elegant .txdoc-doc-meta h1{color:#7c3aed}.txdoc-template-elegant .txdoc-client-box{background:#faf5ff;border:1px solid #ddd6fe;border-radius:22px}.txdoc-template-elegant .txdoc-preview-table th{background:linear-gradient(135deg,#7c3aed,#9333ea)}.txdoc-template-elegant .txdoc-total-box{background:#faf5ff;border:1px solid #ddd6fe}.txdoc-template-elegant .txdoc-total-box h3{border-top:1px solid #c4b5fd;color:#6d28d9}
.txdoc-print-area{display:none}
@media(max-width:1100px){.txdoc-grid{grid-template-columns:1fr}.txdoc-preview-panel{position:relative;top:0}}@media(max-width:820px){.txdoc-template-cards{grid-template-columns:1fr 1fr}}@media(max-width:720px){.txdoc-top,.txdoc-control{align-items:stretch;flex-direction:column}.txdoc-actions{flex-direction:column}.txdoc-form-grid,.txdoc-doc-bottom{grid-template-columns:1fr}.txdoc-item-row{grid-template-columns:1fr}.txdoc-item-head{display:none}.txdoc-paper,.txdoc-template-minimal{padding:22px}.txdoc-doc-top{flex-direction:column}.txdoc-doc-meta{text-align:left}}@media(max-width:520px){.txdoc-template-cards{grid-template-columns:1fr}}
@media print{body *{visibility:hidden!important}.txdoc-print-area,.txdoc-print-area *{visibility:visible!important}.txdoc-print-area{display:block!important;position:absolute!important;inset:0 auto auto 0!important;width:100%!important;padding:0!important;margin:0!important;background:#fff!important;z-index:999999!important}.txdoc-print-area .txdoc-paper{width:100%!important;max-width:100%!important;min-height:auto!important;margin:0!important;box-shadow:none!important;page-break-inside:avoid!important;break-inside:avoid!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.txdoc-print-area .txdoc-paper,.txdoc-print-area .txdoc-paper *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.txdoc-print-area .txdoc-template-corporate .txdoc-doc-meta{background:#1e3a8a!important;color:#fff!important}.txdoc-print-area .txdoc-template-corporate .txdoc-doc-meta *{color:#fff!important}.txdoc-print-area .txdoc-template-corporate .txdoc-preview-table th{background:#1e3a8a!important;color:#fff!important}.txdoc-print-area .txdoc-template-elegant .txdoc-preview-table th{background:#7c3aed!important;color:#fff!important}}

/* v10 popup print engine disables in-page print containers */
@media print{.txbt-print-area,.txdoc-print-area{display:none!important}}

/* v11 template/currency/print stability */
.txdoc-template-cards{align-items:stretch!important}
.txdoc-template-card{min-height:150px!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important}
.txdoc-template-thumb{flex:0 0 58px!important;width:100%!important}
.txdoc-primary-btn,.txdoc-secondary-btn,.txdoc-light-btn,.txdoc-danger-btn,.txdoc-icon-btn{line-height:1.2!important;text-decoration:none!important}
.txdoc-field select{height:auto!important;min-height:50px!important;appearance:auto!important;-webkit-appearance:menulist!important}
@media print{.txdoc-print-area{display:none!important}}

/* v12 no-popup iframe print */
.txbt-print-frame-v12{position:fixed!important;width:0!important;height:0!important;border:0!important;opacity:0!important;pointer-events:none!important}
@media print{.txbt-print-frame-v12,.txbt-print-area,.txdoc-print-area{display:none!important}}

.txdoc-template-cards{align-items:stretch!important}
.txdoc-template-card{min-height:150px!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important}
.txdoc-template-thumb{flex:0 0 58px!important;width:100%!important}
.txdoc-field select{height:auto!important;min-height:50px!important;appearance:auto!important;-webkit-appearance:menulist!important}

/* v13 single-run iframe print */
.txbt-print-frame-v13{position:fixed!important;width:0!important;height:0!important;border:0!important;opacity:0!important;pointer-events:none!important}
@media print{.txbt-print-frame-v13,.txbt-print-frame-v12,.txbt-print-area,.txdoc-print-area{display:none!important}}

/* Toolxora Business Toolkit v14 - theme controlled */
.txdoc-hero,.txbt-hero,.txdoc-tool-hero,.txbt-tool-hero,.txdoc-header-card,.txbt-header-card,.txdoc-top-hero,.txbt-top-hero,.txdoc-generator-hero,.txbt-generator-hero,.txdoc-top,.txbt-top{display:none!important}
.txdoc-dark-toggle,.txbt-dark-toggle,.txdoc-theme-toggle,.txbt-theme-toggle,.txdoc-mode-toggle,.txbt-mode-toggle{display:none!important}
.txdoc-tool,.txbt-invoice-generator{padding-top:0!important;overflow:visible!important}
.txdoc-preview-panel,.txbt-preview-panel,.txdoc-preview-wrap,.txbt-preview-wrap,.txdoc-live-preview,.txbt-live-preview,[data-preview-panel]{position:sticky!important;top:110px!important;align-self:flex-start!important;height:fit-content!important;z-index:3}
.txdoc-grid,.txbt-grid,.txdoc-layout,.txbt-layout,.txdoc-app-grid,.txbt-app-grid{align-items:flex-start!important;overflow:visible!important}
.txdoc-panel,.txbt-panel{overflow:visible!important}
@media(max-width:1024px){.txdoc-preview-panel,.txbt-preview-panel,.txdoc-preview-wrap,.txbt-preview-wrap,.txdoc-live-preview,.txbt-live-preview,[data-preview-panel]{position:relative!important;top:auto!important}}
body.tx-dark-mode .txdoc-tool,html.tx-dark-mode .txdoc-tool,body.tx-dark-mode .txbt-invoice-generator,html.tx-dark-mode .txbt-invoice-generator{background:#020617!important;color:#e5e7eb!important}
body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-preview-wrap,body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-preview-wrap,body.tx-dark-mode .txbt-card,html.tx-dark-mode .txdoc-panel,html.tx-dark-mode .txdoc-control,html.tx-dark-mode .txdoc-preview-panel,html.tx-dark-mode .txdoc-preview-wrap,html.tx-dark-mode .txbt-panel,html.tx-dark-mode .txbt-control,html.tx-dark-mode .txbt-preview-panel,html.tx-dark-mode .txbt-preview-wrap,html.tx-dark-mode .txbt-card{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}
body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,html.tx-dark-mode .txdoc-field input,html.tx-dark-mode .txdoc-field select,html.tx-dark-mode .txdoc-field textarea,html.tx-dark-mode .txbt-field input,html.tx-dark-mode .txbt-field select,html.tx-dark-mode .txbt-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txdoc-template-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txdoc-item-row,body.tx-dark-mode .txbt-item-row,html.tx-dark-mode .txdoc-template-card,html.tx-dark-mode .txbt-template-card,html.tx-dark-mode .txdoc-item-row,html.tx-dark-mode .txbt-item-row{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,html.tx-dark-mode .txdoc-paper,html.tx-dark-mode .txdoc-paper *,html.tx-dark-mode .txbt-invoice-paper,html.tx-dark-mode .txbt-invoice-paper *{color-scheme:light!important}
body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txbt-invoice-paper,html.tx-dark-mode .txdoc-paper,html.tx-dark-mode .txbt-invoice-paper{background:#fff!important;color:#111827!important}

/* Toolxora Business Toolkit v15 - remove remaining internal hero/header cards */
.txbt-invoice-generator > .txbt-card:first-child,
.txbt-invoice-generator > .txbt-header:first-child,
.txbt-invoice-generator > .txbt-intro:first-child,
.txbt-invoice-generator > .txbt-hero:first-child,
.txbt-invoice-generator > .txbt-tool-header:first-child,
.txbt-invoice-generator > .txbt-generator-header:first-child,
.txbt-invoice-generator .txbt-top,
.txbt-invoice-generator .txbt-hero,
.txbt-invoice-generator .txbt-header,
.txbt-invoice-generator .txbt-intro,
.txbt-invoice-generator .txbt-tool-header,
.txbt-invoice-generator .txbt-generator-header {
  display: none !important;
}
.txbt-badge,
.txbt-tool-badge,
.txbt-kicker,
.txbt-invoice-generator .txbt-badge,
.txbt-invoice-generator .txbt-tool-badge,
.txbt-invoice-generator .txbt-kicker {
  display: none !important;
}
@supports selector(:has(*)) {
  .txbt-invoice-generator > section:first-child:has(.txbt-badge),
  .txbt-invoice-generator > div:first-child:has(.txbt-badge),
  .txbt-invoice-generator > section:first-child:has(.txbt-title),
  .txbt-invoice-generator > div:first-child:has(.txbt-title),
  .txbt-invoice-generator .txbt-card:has(.txbt-badge),
  .txbt-invoice-generator .txbt-card:has(.txbt-kicker),
  .txbt-invoice-generator .txbt-card:has(.txbt-tool-badge),
  .txbt-invoice-generator .txbt-card:has(.txbt-title) {
    display: none !important;
  }
}

/* v16 backup: remove internal generator headers */
.txbt-invoice-generator .txbt-top,
.txbt-invoice-generator .txbt-hero,
.txbt-invoice-generator .txbt-header,
.txbt-invoice-generator .txbt-intro,
.txbt-invoice-generator .txbt-tool-header,
.txbt-invoice-generator .txbt-generator-header,
.txdoc-tool .txdoc-top,
.txdoc-tool .txdoc-hero,
.txdoc-tool .txdoc-header,
.txdoc-tool .txdoc-intro {
  display: none !important;
}
@supports selector(:has(*)) {
  .txbt-invoice-generator div:has(> .txbt-badge):has(button),
  .txbt-invoice-generator section:has(> .txbt-badge):has(button),
  .txbt-invoice-generator div:has(> .txbt-kicker):has(button),
  .txbt-invoice-generator section:has(> .txbt-kicker):has(button) {
    display: none !important;
  }
}

/* Toolxora Business Toolkit v17 actual layout/sticky fix */
.txbt-invoice-tool,
.txdoc-tool {
  overflow: visible !important;
}

.txbt-grid,
.txdoc-grid {
  align-items: flex-start !important;
  overflow: visible !important;
}

.txbt-panel,
.txdoc-panel {
  overflow: visible !important;
}

.txbt-preview-panel,
.txdoc-preview-panel {
  position: sticky !important;
  top: 96px !important;
  align-self: flex-start !important;
  height: fit-content !important;
  z-index: 5 !important;
}

@media(max-width:1100px){
  .txbt-preview-panel,
  .txdoc-preview-panel {
    position: relative !important;
    top: auto !important;
  }
}

/* theme-controlled dark mode, actual roots */
body.tx-dark-mode .txbt-invoice-tool,
html.tx-dark-mode .txbt-invoice-tool,
html[data-theme="dark"] .txbt-invoice-tool,
body.tx-dark-mode .txdoc-tool,
html.tx-dark-mode .txdoc-tool,
html[data-theme="dark"] .txdoc-tool {
  background: #020617 !important;
  color: #e5e7eb !important;
}

body.tx-dark-mode .txbt-panel,
body.tx-dark-mode .txbt-control-bar,
body.tx-dark-mode .txbt-preview-panel,
body.tx-dark-mode .txdoc-panel,
body.tx-dark-mode .txdoc-control,
body.tx-dark-mode .txdoc-preview-panel,
html[data-theme="dark"] .txbt-panel,
html[data-theme="dark"] .txbt-control-bar,
html[data-theme="dark"] .txbt-preview-panel,
html[data-theme="dark"] .txdoc-panel,
html[data-theme="dark"] .txdoc-control,
html[data-theme="dark"] .txdoc-preview-panel {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border-color: #1e293b !important;
}

body.tx-dark-mode .txbt-field input,
body.tx-dark-mode .txbt-field select,
body.tx-dark-mode .txbt-field textarea,
body.tx-dark-mode .txdoc-field input,
body.tx-dark-mode .txdoc-field select,
body.tx-dark-mode .txdoc-field textarea,
html[data-theme="dark"] .txbt-field input,
html[data-theme="dark"] .txbt-field select,
html[data-theme="dark"] .txbt-field textarea,
html[data-theme="dark"] .txdoc-field input,
html[data-theme="dark"] .txdoc-field select,
html[data-theme="dark"] .txdoc-field textarea {
  background: #111827 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

/* PDF paper white */
body.tx-dark-mode .txbt-invoice-paper,
body.tx-dark-mode .txbt-invoice-paper *,
body.tx-dark-mode .txdoc-paper,
body.tx-dark-mode .txdoc-paper *,
html[data-theme="dark"] .txbt-invoice-paper,
html[data-theme="dark"] .txbt-invoice-paper *,
html[data-theme="dark"] .txdoc-paper,
html[data-theme="dark"] .txdoc-paper * {
  color-scheme: light !important;
}
body.tx-dark-mode .txbt-invoice-paper,
body.tx-dark-mode .txdoc-paper,
html[data-theme="dark"] .txbt-invoice-paper,
html[data-theme="dark"] .txdoc-paper {
  background: #fff !important;
  color: #111827 !important;
}

/* Toolxora Business Toolkit v18 - real invoice restore + sticky fix */
.txbt-template-cards{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important;align-items:stretch!important;overflow:visible!important}
.txbt-template-card{display:block!important;visibility:visible!important;opacity:1!important}
.txbt-template-card[data-template="modern"]{display:block!important}
.txbt-invoice-tool,.txdoc-tool{overflow:visible!important}
.txbt-grid,.txdoc-grid{align-items:flex-start!important;overflow:visible!important;display:grid!important}
.txbt-panel,.txdoc-panel{overflow:visible!important;min-width:0!important}
.txbt-preview-panel,.txdoc-preview-panel{position:sticky!important;top:96px!important;align-self:flex-start!important;max-height:none!important;overflow:visible!important;height:auto!important;z-index:60!important}
@media(max-width:1100px){.txbt-grid,.txdoc-grid{grid-template-columns:1fr!important}.txbt-preview-panel,.txdoc-preview-panel{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important}}
@media(max-width:820px){.txbt-template-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:520px){.txbt-template-cards{grid-template-columns:1fr!important}}
body.tx-dark-mode .txbt-invoice-tool,html.tx-dark-mode .txbt-invoice-tool,html[data-theme="dark"] .txbt-invoice-tool,body.tx-dark-mode .txdoc-tool,html.tx-dark-mode .txdoc-tool,html[data-theme="dark"] .txdoc-tool{background:#020617!important;color:#e5e7eb!important}
body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control-bar,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txbt-item-row,body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-template-card,html[data-theme="dark"] .txbt-panel,html[data-theme="dark"] .txbt-control-bar,html[data-theme="dark"] .txbt-preview-panel,html[data-theme="dark"] .txbt-card,html[data-theme="dark"] .txbt-template-card,html[data-theme="dark"] .txbt-item-row,html[data-theme="dark"] .txdoc-panel,html[data-theme="dark"] .txdoc-control,html[data-theme="dark"] .txdoc-preview-panel,html[data-theme="dark"] .txdoc-template-card{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}
body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,html[data-theme="dark"] .txbt-field input,html[data-theme="dark"] .txbt-field select,html[data-theme="dark"] .txbt-field textarea,html[data-theme="dark"] .txdoc-field input,html[data-theme="dark"] .txdoc-field select,html[data-theme="dark"] .txdoc-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txbt-invoice-paper *,html[data-theme="dark"] .txdoc-paper,html[data-theme="dark"] .txdoc-paper *{color-scheme:light!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txdoc-paper,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txdoc-paper{background:#fff!important;color:#111827!important}

/* =========================================================
   Toolxora Business Toolkit v19 FINAL: no internal preview scrollbar + sticky
   ========================================================= */
.txbt-invoice-tool,.txdoc-tool,.txbt-grid,.txdoc-grid,.txbt-panel,.txdoc-panel{overflow:visible!important}.txbt-grid,.txdoc-grid{align-items:flex-start!important}.txbt-preview-panel,.txdoc-preview-panel{position:sticky!important;top:96px!important;align-self:flex-start!important;height:auto!important;max-height:none!important;overflow:visible!important;z-index:60!important}.txbt-preview-panel .txbt-invoice-paper,.txdoc-preview-panel .txdoc-paper{max-height:none!important;overflow:visible!important}@media(max-width:1100px){.txbt-grid,.txdoc-grid{grid-template-columns:1fr!important}.txbt-preview-panel,.txdoc-preview-panel{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important}}
/* Follow theme dark mode */
body.tx-dark-mode .txbt-invoice-tool,html[data-theme="dark"] .txbt-invoice-tool,body.tx-dark-mode .txdoc-tool,html[data-theme="dark"] .txdoc-tool{background:#020617!important;color:#e5e7eb!important}body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control-bar,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txbt-item-row,body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-template-card,html[data-theme="dark"] .txbt-panel,html[data-theme="dark"] .txbt-control-bar,html[data-theme="dark"] .txbt-preview-panel,html[data-theme="dark"] .txbt-card,html[data-theme="dark"] .txbt-template-card,html[data-theme="dark"] .txbt-item-row,html[data-theme="dark"] .txdoc-panel,html[data-theme="dark"] .txdoc-control,html[data-theme="dark"] .txdoc-preview-panel,html[data-theme="dark"] .txdoc-template-card{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,html[data-theme="dark"] .txbt-field input,html[data-theme="dark"] .txbt-field select,html[data-theme="dark"] .txbt-field textarea,html[data-theme="dark"] .txdoc-field input,html[data-theme="dark"] .txdoc-field select,html[data-theme="dark"] .txdoc-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txbt-invoice-paper *,html[data-theme="dark"] .txdoc-paper,html[data-theme="dark"] .txdoc-paper *{color-scheme:light!important}body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txdoc-paper,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txdoc-paper{background:#fff!important;color:#111827!important}

/* =========================================================
   Toolxora Business Toolkit v20 FINAL: sticky preview, no internal scrollbar
   ========================================================= */
.txbt-invoice-tool,.txdoc-tool{overflow:visible!important}
.txbt-grid,.txdoc-grid{align-items:flex-start!important;overflow:visible!important}
.txbt-panel,.txdoc-panel{overflow:visible!important;min-width:0!important}
.txbt-preview-panel,.txdoc-preview-panel{
  position:-webkit-sticky!important;
  position:sticky!important;
  top:96px!important;
  align-self:flex-start!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  z-index:80!important;
}
.txbt-preview-panel::-webkit-scrollbar,.txdoc-preview-panel::-webkit-scrollbar{display:none}
.txbt-preview-panel,.txdoc-preview-panel{scrollbar-width:none}
.txbt-preview-panel .txbt-invoice-paper,.txdoc-preview-panel .txdoc-paper{max-height:none!important;overflow:visible!important}
@media(max-width:1100px){
  .txbt-grid,.txdoc-grid{grid-template-columns:1fr!important}
  .txbt-preview-panel,.txdoc-preview-panel{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important}
}
/* Theme dark mode follows body/html */
body.tx-dark-mode .txbt-invoice-tool,body.tx-dark-mode .txdoc-tool,html[data-theme="dark"] .txbt-invoice-tool,html[data-theme="dark"] .txdoc-tool{background:#020617!important;color:#e5e7eb!important}
body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control-bar,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txbt-item-row,body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-template-card,body.tx-dark-mode .txdoc-item-row,
html[data-theme="dark"] .txbt-panel,html[data-theme="dark"] .txbt-control-bar,html[data-theme="dark"] .txbt-preview-panel,html[data-theme="dark"] .txbt-card,html[data-theme="dark"] .txbt-template-card,html[data-theme="dark"] .txbt-item-row,html[data-theme="dark"] .txdoc-panel,html[data-theme="dark"] .txdoc-control,html[data-theme="dark"] .txdoc-preview-panel,html[data-theme="dark"] .txdoc-template-card,html[data-theme="dark"] .txdoc-item-row{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}
body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,
html[data-theme="dark"] .txbt-field input,html[data-theme="dark"] .txbt-field select,html[data-theme="dark"] .txbt-field textarea,html[data-theme="dark"] .txdoc-field input,html[data-theme="dark"] .txdoc-field select,html[data-theme="dark"] .txdoc-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txbt-invoice-paper *,html[data-theme="dark"] .txdoc-paper,html[data-theme="dark"] .txdoc-paper *{color-scheme:light!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txdoc-paper,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txdoc-paper{background:#fff!important;color:#111827!important}

/* v21 final override specific previous preview scrollbar rule */
.txbt-invoice-tool .txbt-preview-panel,
.txdoc-tool .txdoc-preview-panel{
  position:-webkit-sticky!important;
  position:sticky!important;
  top:96px!important;
  align-self:flex-start!important;
  height:auto!important;
  max-height:none!important;
  overflow-x:visible!important;
  overflow-y:visible!important;
  overflow:visible!important;
  z-index:100!important;
}
@media(max-width:1100px){
  .txbt-invoice-tool .txbt-preview-panel,
  .txdoc-tool .txdoc-preview-panel{
    position:relative!important;
    top:auto!important;
  }
}

/* v21 verified sticky override: overflow-x hidden on body breaks position:sticky */
html,body{
  overflow-x:clip!important;
  overflow-y:visible!important;
}
@supports not (overflow-x:clip){
  html{overflow-x:hidden!important;overflow-y:visible!important}
  body{overflow-x:visible!important;overflow-y:visible!important}
}


/* =========================================================
   Toolxora Business Toolkit v21
   PDF/Live Preview paper must stay exactly light in dark mode
   ========================================================= */

body.tx-dark-mode .txbt-preview-panel,
html.tx-dark-mode .txbt-preview-panel,
html[data-theme="dark"] .txbt-preview-panel,
body.tx-dark-mode .txdoc-preview-panel,
html.tx-dark-mode .txdoc-preview-panel,
html[data-theme="dark"] .txdoc-preview-panel {
  color-scheme: light !important;
}

/* Paper container stays white */
body.tx-dark-mode .txbt-invoice-paper,
html.tx-dark-mode .txbt-invoice-paper,
html[data-theme="dark"] .txbt-invoice-paper,
body.tx-dark-mode .txdoc-paper,
html.tx-dark-mode .txdoc-paper,
html[data-theme="dark"] .txdoc-paper {
  background: #ffffff !important;
  color: #111827 !important;
  color-scheme: light !important;
}

/* Neutralize global dark text rules inside paper */
body.tx-dark-mode .txbt-invoice-paper h1,
body.tx-dark-mode .txbt-invoice-paper h2,
body.tx-dark-mode .txbt-invoice-paper h3,
body.tx-dark-mode .txbt-invoice-paper h4,
body.tx-dark-mode .txbt-invoice-paper h5,
body.tx-dark-mode .txbt-invoice-paper h6,
body.tx-dark-mode .txbt-invoice-paper p,
body.tx-dark-mode .txbt-invoice-paper div,
body.tx-dark-mode .txbt-invoice-paper span,
body.tx-dark-mode .txbt-invoice-paper td,
body.tx-dark-mode .txbt-invoice-paper th,
body.tx-dark-mode .txbt-invoice-paper strong,
body.tx-dark-mode .txbt-invoice-paper b,
body.tx-dark-mode .txbt-invoice-paper small,
html[data-theme="dark"] .txbt-invoice-paper h1,
html[data-theme="dark"] .txbt-invoice-paper h2,
html[data-theme="dark"] .txbt-invoice-paper h3,
html[data-theme="dark"] .txbt-invoice-paper h4,
html[data-theme="dark"] .txbt-invoice-paper h5,
html[data-theme="dark"] .txbt-invoice-paper h6,
html[data-theme="dark"] .txbt-invoice-paper p,
html[data-theme="dark"] .txbt-invoice-paper div,
html[data-theme="dark"] .txbt-invoice-paper span,
html[data-theme="dark"] .txbt-invoice-paper td,
html[data-theme="dark"] .txbt-invoice-paper th,
html[data-theme="dark"] .txbt-invoice-paper strong,
html[data-theme="dark"] .txbt-invoice-paper b,
html[data-theme="dark"] .txbt-invoice-paper small,
body.tx-dark-mode .txdoc-paper h1,
body.tx-dark-mode .txdoc-paper h2,
body.tx-dark-mode .txdoc-paper h3,
body.tx-dark-mode .txdoc-paper h4,
body.tx-dark-mode .txdoc-paper h5,
body.tx-dark-mode .txdoc-paper h6,
body.tx-dark-mode .txdoc-paper p,
body.tx-dark-mode .txdoc-paper div,
body.tx-dark-mode .txdoc-paper span,
body.tx-dark-mode .txdoc-paper td,
body.tx-dark-mode .txdoc-paper th,
body.tx-dark-mode .txdoc-paper strong,
body.tx-dark-mode .txdoc-paper b,
body.tx-dark-mode .txdoc-paper small,
html[data-theme="dark"] .txdoc-paper h1,
html[data-theme="dark"] .txdoc-paper h2,
html[data-theme="dark"] .txdoc-paper h3,
html[data-theme="dark"] .txdoc-paper h4,
html[data-theme="dark"] .txdoc-paper h5,
html[data-theme="dark"] .txdoc-paper h6,
html[data-theme="dark"] .txdoc-paper p,
html[data-theme="dark"] .txdoc-paper div,
html[data-theme="dark"] .txdoc-paper span,
html[data-theme="dark"] .txdoc-paper td,
html[data-theme="dark"] .txdoc-paper th,
html[data-theme="dark"] .txdoc-paper strong,
html[data-theme="dark"] .txdoc-paper b,
html[data-theme="dark"] .txdoc-paper small {
  color: #111827 !important;
}

/* Secondary/muted text in paper should remain readable like light mode */
body.tx-dark-mode .txbt-invoice-paper .muted,
body.tx-dark-mode .txbt-invoice-paper .txbt-muted,
body.tx-dark-mode .txbt-invoice-paper .txbt-paper-muted,
body.tx-dark-mode .txbt-invoice-paper .txbt-invoice-muted,
body.tx-dark-mode .txbt-invoice-paper [class*="muted"],
body.tx-dark-mode .txdoc-paper .muted,
body.tx-dark-mode .txdoc-paper .txdoc-muted,
body.tx-dark-mode .txdoc-paper [class*="muted"],
html[data-theme="dark"] .txbt-invoice-paper .muted,
html[data-theme="dark"] .txbt-invoice-paper .txbt-muted,
html[data-theme="dark"] .txbt-invoice-paper .txbt-paper-muted,
html[data-theme="dark"] .txbt-invoice-paper .txbt-invoice-muted,
html[data-theme="dark"] .txbt-invoice-paper [class*="muted"],
html[data-theme="dark"] .txdoc-paper .muted,
html[data-theme="dark"] .txdoc-paper .txdoc-muted,
html[data-theme="dark"] .txdoc-paper [class*="muted"] {
  color: #64748b !important;
}

/* Preserve invoice/quote/receipt title and accent colors */
body.tx-dark-mode .txbt-invoice-paper .txbt-paper-title,
body.tx-dark-mode .txbt-invoice-paper .txbt-invoice-title,
body.tx-dark-mode .txbt-invoice-paper [class*="title"],
html[data-theme="dark"] .txbt-invoice-paper .txbt-paper-title,
html[data-theme="dark"] .txbt-invoice-paper .txbt-invoice-title,
html[data-theme="dark"] .txbt-invoice-paper [class*="title"] {
  color: inherit !important;
}

/* Common accent classes/inline accent sections must not be forced black */
body.tx-dark-mode .txbt-invoice-paper [style*="color"],
body.tx-dark-mode .txdoc-paper [style*="color"],
html[data-theme="dark"] .txbt-invoice-paper [style*="color"],
html[data-theme="dark"] .txdoc-paper [style*="color"] {
  color: revert-layer;
}

/* Tables/lines remain light-mode colors */
body.tx-dark-mode .txbt-invoice-paper table,
body.tx-dark-mode .txbt-invoice-paper tr,
body.tx-dark-mode .txbt-invoice-paper td,
body.tx-dark-mode .txbt-invoice-paper th,
body.tx-dark-mode .txdoc-paper table,
body.tx-dark-mode .txdoc-paper tr,
body.tx-dark-mode .txdoc-paper td,
body.tx-dark-mode .txdoc-paper th,
html[data-theme="dark"] .txbt-invoice-paper table,
html[data-theme="dark"] .txbt-invoice-paper tr,
html[data-theme="dark"] .txbt-invoice-paper td,
html[data-theme="dark"] .txbt-invoice-paper th,
html[data-theme="dark"] .txdoc-paper table,
html[data-theme="dark"] .txdoc-paper tr,
html[data-theme="dark"] .txdoc-paper td,
html[data-theme="dark"] .txdoc-paper th {
  border-color: #e5e7eb !important;
}
