/* Exact ExtraTools tables/zip-rar presentation primitives, adapted for Invoice. */
body.invoice-tool {
    color-scheme: light;
    --canvas: #f4f5f0;
    --paper: #fff;
    --ink: #20251f;
    --muted: #737b72;
    --line: #e5e9e1;
    --green: #367251;
    --green-dark: #254c37;
    --green-pale: #eaf2e9;
    --orange: #bd7848;
    --error: #a54838;
    --shadow: 0 16px 48px rgb(33 48 36 / 5%);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.invoice-tool { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); }
:where(body.invoice-tool) select { font: inherit; }
:where(body.invoice-tool) input:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 27%); outline-offset: 2px; }
:where(body.invoice-tool) select:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 27%); outline-offset: 2px; }
:where(body.invoice-tool) [tabindex="0"]:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 27%); outline-offset: 2px; }
:where(body.invoice-tool) .app-shell { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }
:where(body.invoice-tool) .topbar { display: flex; height: 72px; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e8df; }
:where(body.invoice-tool) .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 16.33333px; font-weight: 800; letter-spacing: -.6px; text-decoration: none; }
:where(body.invoice-tool) .brand-mark { display: flex; width: 21px; height: 21px; align-items: end; gap: 2px; padding: 4px; border-radius: 7px; background: var(--green); }
:where(body.invoice-tool) .brand-mark span { width: 3px; border-radius: 2px; background: #fff; }
:where(body.invoice-tool) .brand-mark span:nth-child(1) { height: 6px; }
:where(body.invoice-tool) .brand-mark span:nth-child(2) { height: 11px; }
:where(body.invoice-tool) .brand-mark span:nth-child(3) { height: 8px; }
:where(body.invoice-tool) .local-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fafbf8; color: #5e685f; font-size: 12.33333px; font-weight: 600; }
:where(body.invoice-tool) .local-badge > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); }
:where(body.invoice-tool) .hero { max-width: 820px; padding: 48px 0 12px; }
:where(body.invoice-tool) .eyebrow { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.3px; }
:where(body.invoice-tool) .section-label { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.3px; }
:where(body.invoice-tool) .hero h1 { margin: 12px 0; font-size: clamp(39.33333px, calc(5vw + 1.33333px), 56.33333px); line-height: 1.08; letter-spacing: -2.5px; }
:where(body.invoice-tool) .hero h1 span { color: var(--green); }
:where(body.invoice-tool) .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 18px; }:where(body.invoice-tool) .utility-button { display: inline-flex; align-items: center; justify-content: center; }
:where(body.invoice-tool) .mode-note { color: var(--muted); font-size: 11.33333px; line-height: 1.45; }
:where(body.invoice-tool) .tool-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
:where(body.invoice-tool) .card-topline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.invoice-tool) .progress-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.invoice-tool) .contents-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.invoice-tool) .section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.invoice-tool) .editor-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.invoice-tool) .card-index { color: #737b72; font-size: 10.33333px; font-weight: 700; letter-spacing: 1px; }
:where(body.invoice-tool) .card-meta { color: #7a8379; font-size: 11.33333px; line-height: 1.5; }
:where(body.invoice-tool) .panel-note { color: #7a8379; font-size: 11.33333px; line-height: 1.5; }
:where(body.invoice-tool) .tool-card h2 { margin: 12px 0 16px; font-size: 20.33333px; letter-spacing: -.5px; }
:where(body.invoice-tool) .settings-panel h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.invoice-tool) .editor-panel h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.invoice-tool) .export-panel h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.invoice-tool) .section-heading h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.invoice-tool) .settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(125px, .8fr) minmax(125px, .8fr) minmax(190px, 1.3fr); align-items: end; gap: 12px; margin-top: 15px; }
:where(body.invoice-tool) .field { display: grid; min-width: 0; gap: 6px; color: #39473c; font-size: 11.33333px; font-weight: 650; }
:where(body.invoice-tool) .field input { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #e4e9e2; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12.33333px; }
:where(body.invoice-tool) .field select { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #e4e9e2; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12.33333px; }
:where(body.invoice-tool) .field input:focus-visible { border-color: var(--green-border-strong); }
:where(body.invoice-tool) .field select:focus-visible { border-color: var(--green-border-strong); }
:where(body.invoice-tool) .field--wide { grid-column: span 1; }
:where(body.invoice-tool) .column-types-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
:where(body.invoice-tool) .action-status { margin: 12px 0 0; color: #6c776d; font-size: 11.33333px; line-height: 1.5; }
:where(body.invoice-tool) .error-status { margin: 9px 0 0; padding: 10px 11px; border: 1px solid #eed9d5; border-radius: 8px; background: #fff8f6; color: var(--error); font-size: 12.33333px; line-height: 1.5; }
:where(body.invoice-tool) .result-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 13px; padding: 14px; border: 1px solid #dce8dc; border-radius: 9px; background: #f7faf6; }
:where(body.invoice-tool) .result-panel > div { display: grid; gap: 4px; min-width: 0; }
:where(body.invoice-tool) .result-panel strong { overflow-wrap: anywhere; color: var(--green-dark); font-size: 13.33333px; }
:where(body.invoice-tool) .result-panel span { color: #6e786e; font-size: 11.33333px; }
:where(body.invoice-tool) .footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 38px; padding: 17px 0 24px; border-top: 1px solid #e4e8df; color: #7a8379; font-size: 11.33333px; }
:where(body.invoice-tool) .utility-dialog { width: min(610px, calc(100% - 30px)); max-height: min(80vh, 760px); padding: 22px; overflow: auto; border: 1px solid #dfe7de; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px rgb(18 33 24 / 22%); }
:where(body.invoice-tool) .utility-dialog::backdrop { background: rgb(21 30 23 / 48%); }
:where(body.invoice-tool) .utility-dialog h2 { margin: 9px 0 12px; color: #2d3c31; font-size: 20.33333px; }
:where(body.invoice-tool) .utility-dialog ul { padding-left: 20px; color: #566157; font-size: 13.33333px; line-height: 1.7; }
:where(body.invoice-tool) .utility-dialog li { margin: 7px 0; }
:where(body.invoice-tool) .dialog-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }:where(body.invoice-tool) .dialog-close { display: grid; width: 32px; height: 32px; place-items: center; }
:where(body.invoice-tool) .dialog-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #edf0eb; color: var(--muted); font-size: 11.33333px; line-height: 1.6; }
:where(body.invoice-tool) .utility-dialog--error { border-top: 4px solid var(--error); }
:where(body.invoice-tool) #error-dialog-message { color: #586157; font-size: 13.33333px; line-height: 1.65; }
:where(body.invoice-tool) .tool-brand-header {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    gap: 0 .75rem;
    height: auto;
    min-height: 72px;
    padding-block: .45rem;
}
:where(body.invoice-tool) .tool-brand-tagline {
    flex: 0 0 100%;
    order: 10;
    width: 100%;
    margin: .15rem 0 0;
    color: #68756b;
    font-size: 0.78333rem;
    font-weight: 700;
    letter-spacing: .09em;
    line-height: 1.4;
    text-transform: uppercase;
}
:where(body.invoice-tool) .tool-breadcrumbs {
    display: block;
    width: 100%;
    margin: 0 0 clamp(12px, 1.7vw, 20px);
    color: #68756b;
    font: inherit;
    font-size: 0.88333rem;
    line-height: 1.5;
}
:where(body.invoice-tool) .tool-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
:where(body.invoice-tool) .tool-breadcrumbs li + li::before {
    content: "/";
    margin-right: .35rem;
    color: #9aa59b;
}
:where(body.invoice-tool) .tool-breadcrumbs ol a {
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    padding: .28rem .78rem;
    border: 1px solid var(--green-border);
    border-radius: 999px;
    background: var(--green-pale);
    box-shadow: 0 1px 2px rgb(37 76 55 / 8%);
    color: var(--green-dark);
    font-weight: 750;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
:where(body.invoice-tool) .tool-breadcrumbs ol a:hover {
    border-color: var(--green);
    background: var(--green-pale-hover);
    color: var(--green-deep);
}
:where(body.invoice-tool) .tool-brand-tagline {
    box-sizing: border-box;
}

/* Invoice Generator extends the exact ExtraTools site, header, fields and button primitives. */
/* All accent tokens are inherited from the site's original theme rules in embed/styles.css. */
body.invoice-tool {
  --invoice-ui-field-border: var(--green-border-soft, #c1d0c4);
  --invoice-ui-card-border: var(--line, #e3e8e0);
  --invoice-ui-pane: color-mix(in srgb, var(--paper, white) 85%, var(--green-soft, #f1f6ef));
  --invoice-ui-quiet: var(--muted, #717a71);
  --invoice-ui-ring: rgb(var(--green-rgb, 54 114 81) / 28%);
}
/* The site owns the sole theme selector; invoice controls consume its CSS custom properties. */

body.invoice-tool *,body.invoice-tool *::before,body.invoice-tool *::after { box-sizing:border-box; }
body.invoice-tool .app-shell.is-simple [data-advanced] { display:none!important; }
body.invoice-tool .field { display:grid; gap:7px; min-width:0; color:var(--ink); font-size:12px; font-weight:650; }
body.invoice-tool .field :where(input:not([type="file"]), select, textarea) { width:100%; min-width:0; min-height:42px; padding:9px 11px; border:1px solid var(--invoice-ui-field-border); border-radius:8px; background:#fff; color:var(--ink); font:400 13px/1.4 'Segoe UI',Arial,sans-serif; }
body.invoice-tool .field textarea { min-height:75px; resize:vertical; line-height:1.65; }
body.invoice-tool .field :where(input,textarea,select):focus-visible { border-color:var(--green); outline:2px solid var(--green-border-strong); outline-offset:1px; }
body.invoice-tool .inv-section { min-width:0; margin-top:18px; padding:17px; border:1px solid var(--invoice-ui-card-border); border-radius:11px; background:var(--invoice-ui-pane); }
body.invoice-tool .inv-section > .section-heading { margin-bottom:13px; }
body.invoice-tool .section-heading h3 { margin:4px 0 0; font-size:16px; color:var(--ink); }
body.invoice-tool .inv-grid { display:grid; gap:13px; min-width:0; }
body.invoice-tool .inv-grid--four { grid-template-columns:repeat(4,minmax(0,1fr)); }
body.invoice-tool .inv-grid--two { grid-template-columns:repeat(2,minmax(0,1fr)); }
body.invoice-tool .inv-top-space { margin-top:12px; }
body.invoice-tool .inv-groups { align-items:stretch; gap:13px; }
body.invoice-tool .inv-groups > .inv-section { margin-top:14px; }
body.invoice-tool .inv-section .field + .field { margin-top:12px; }
body.invoice-tool .inv-grid > .field + .field { margin-top:0; }
body.invoice-tool .inv-logo-actions { display:flex; align-items:center; gap:8px; min-width:0; }
body.invoice-tool .inv-logo-actions input { width:min(100%,340px); min-width:0; flex:1; padding:9px; border:1px solid var(--invoice-ui-field-border); border-radius:8px; background:var(--paper); font-size:11px; }
body.invoice-tool .inv-logo-actions button { flex:none; min-height:40px; }
body.invoice-tool .inv-items-header, body.invoice-tool .inv-item-row { display:grid; grid-template-columns:minmax(0,3fr) minmax(85px,.8fr) minmax(100px,1fr) minmax(110px,1fr) 41px; gap:9px; align-items:end; }
body.invoice-tool .inv-items-header { padding:8px 10px; margin-bottom:7px; border-radius:8px; background:var(--green-pale); color:var(--green-dark); font-size:11px; font-weight:700; }
body.invoice-tool .inv-items-editor { display:grid; gap:9px; }
body.invoice-tool .inv-item-row { padding:11px 10px; border:1px solid var(--invoice-ui-card-border); border-radius:8px; background:var(--paper); }
body.invoice-tool .inv-item-row .field { margin:0; }
body.invoice-tool .inv-item-row :where(input) { min-height:40px; }
body.invoice-tool .inv-row-label { display:none; }
body.invoice-tool .inv-item-sum { display:flex; min-height:40px; align-items:center; justify-content:flex-end; overflow-wrap:anywhere; color:var(--green-dark); font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; text-align:end; }
body.invoice-tool .inv-remove-row { display:grid; place-items:center; width:38px; min-height:40px; font-size:21px; padding:0!important; color:#a44639!important; background:#fff8f6!important; border-color:#ebc9c3!important; }
body.invoice-tool .inv-remove-row:hover { background:#ffece8!important; }
body.invoice-tool .primary-actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-top:14px; }
body.invoice-tool .primary-actions > button { min-height:41px; }
body.invoice-tool .editor-hint { color:var(--muted); font-size:12px; line-height:1.65; }
body.invoice-tool .inv-summary { max-width:460px; margin:20px 0 12px auto; padding:14px 17px; border:1px solid var(--green-border); border-radius:11px; background:var(--green-soft); }
body.invoice-tool .inv-summary > div { display:flex; gap:15px; align-items:baseline; justify-content:space-between; padding:7px 0; color:var(--green-dark); font-size:13px; }
body.invoice-tool .inv-summary > div strong { color:var(--ink); font-variant-numeric:tabular-nums; font-size:14px; text-align:end; }
body.invoice-tool .inv-summary > .inv-summary-total { margin-top:4px; padding-top:14px; border-top:1px solid var(--green-border); color:var(--green-dark); font-size:15px; font-weight:800; }
body.invoice-tool .inv-summary > .inv-summary-total strong { font-size:20px; color:var(--green-dark); }
body.invoice-tool .error-status { margin:10px 0; padding:10px 12px; border:1px solid #e8cbc6; border-radius:8px; color:#a54838; background:#fff8f6; line-height:1.55; }
body.invoice-tool .action-status { margin:12px 0; color:var(--muted); font-size:12px; }
body.invoice-tool .inv-export-actions,body.invoice-tool .inv-draft-actions { margin-top:12px; }
body.invoice-tool .inv-draft-actions { border-top:1px solid var(--invoice-ui-card-border); padding-top:12px; }
body.invoice-tool .inv-paper-surround { min-width:0; width:100%; padding:18px; overflow-x:auto; border:1px solid var(--green-border-soft); border-radius:11px; background:var(--green-soft); scrollbar-gutter:stable; }
body.invoice-tool .visually-hidden { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; border:0; clip:rect(0,0,0,0); white-space:nowrap; clip-path:inset(50%); }
body.invoice-tool .seo-details { margin:36px 0 0; padding:22px 0 0; border-top:1px solid var(--line); color:var(--muted); line-height:1.8; }
body.invoice-tool .seo-details h2 { font-size:clamp(18px,2.4vw,24px); color:var(--ink); }
body.invoice-tool .seo-details ul { padding-left:22px; }
body.invoice-tool .seo-details li { margin:6px 0; }
body.invoice-tool :where(button,input,select,textarea,a):focus-visible { outline:3px solid var(--invoice-ui-ring);outline-offset:2px; }
body.invoice-tool :where([hidden]) { display:none!important; }
body.invoice-tool dialog.utility-dialog { position:fixed; z-index:2147483647; padding:22px; width:min(620px,calc(100% - 30px)); max-height:80vh; overflow:auto; border:1px solid var(--invoice-ui-card-border); border-radius:14px; background:#fff; color:var(--ink); box-shadow:0 25px 80px rgb(18 33 24 / 23%); }
body.invoice-tool dialog.utility-dialog::backdrop { background:rgb(21 30 23 / 55%); }
body.invoice-tool .utility-dialog h2 { margin:9px 0 12px; font-size:20px; }
body.invoice-tool .utility-dialog ul { padding-left:20px; color:var(--muted); font-size:13px; line-height:1.7; }
body.invoice-tool .utility-dialog li { margin:6px 0; }
body.invoice-tool .dialog-topline { display:flex; align-items:center; justify-content:space-between; gap:12px; }
body.invoice-tool .dialog-close { display:grid; place-items:center; width:36px; height:36px; padding:0; }
body.invoice-tool .dialog-note { padding-top:12px; border-top:1px solid #e6ebe4; color:#667366; font-size:12px; }
body.invoice-tool .utility-dialog--error { border-top:4px solid #aa473b!important; }
body.invoice-tool :where(#error-dialog-message,#notice-dialog-message) { color:var(--muted); font-size:13px; line-height:1.65; overflow-wrap:anywhere; }

/* Printable invoice: separate document design; website controls retain original ExtraTools appearance. */
body.invoice-tool .inv-paper { --invoice-accent:var(--green-dark, #254c37); --invoice-soft:var(--green-pale, #eaf2e9); width:100%; max-width:794px; min-height:940px; margin-inline:auto; padding:clamp(22px,3.7vw,49px); background:#fff; color:#222c25; font:400 12.5px/1.56 'Segoe UI',Arial,sans-serif; box-shadow:0 9px 35px rgb(21 39 27 / 9%); overflow-wrap:anywhere; hyphens:auto; }
body.invoice-tool .inv-paper--modern { --invoice-accent:var(--green, #367251);--invoice-soft:var(--green-soft, #f1f6ef); }
body.invoice-tool .inv-paper--minimal { --invoice-accent:var(--green-deep, #183d29);--invoice-soft:var(--green-pale, #eaf2e9); }
body.invoice-tool .inv-paper :where(p,h1,h2,table) { margin:0; }
body.invoice-tool .paper-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:39px; }
body.invoice-tool .paper-brand { display:flex; align-items:center; gap:14px; min-width:0; max-width:56%; }
body.invoice-tool .paper-logo { display:block; max-width:116px; max-height:74px; height:auto; width:auto; object-fit:contain; }
body.invoice-tool .paper-logo-placeholder { display:grid; flex:none; place-items:center; width:60px; height:56px; border-radius:8px; background:var(--invoice-soft); color:var(--invoice-accent); font-size:13px; font-weight:900; letter-spacing:.7px; }
body.invoice-tool .paper-company-head { min-width:0; }
body.invoice-tool .paper-company-name { color:#26372b; font-size:17px; font-weight:800; line-height:1.23; }
body.invoice-tool .paper-muted { margin-top:4px; color:#7a837b; font-size:11px; }
body.invoice-tool .paper-title-block { min-width:0; text-align:right; }
body.invoice-tool .paper-doc-title { color:var(--invoice-accent); font-size:clamp(19px,2.5vw,30px); font-weight:850; letter-spacing:-.6px; line-height:1.15; }
body.invoice-tool .paper-document-number { margin-top:8px; color:#5e695f; font-size:12px; }
body.invoice-tool .paper-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-bottom:30px; }
body.invoice-tool .paper-info-column { display:grid; align-content:start; gap:22px; min-width:0; }
body.invoice-tool .paper-label { margin-bottom:6px!important; color:var(--invoice-accent); font-size:10px; font-weight:850; letter-spacing:1.4px; }
body.invoice-tool .paper-name { font-size:13.5px; font-weight:750; color:#283b2e; }
body.invoice-tool .paper-contact { min-width:0; }
body.invoice-tool .paper-contact .paper-multiline { margin-top:5px; }
body.invoice-tool .paper-multiline { color:#58665d; white-space:pre-line; overflow-wrap:anywhere; }
body.invoice-tool .paper-dates { display:grid; gap:5px; margin-top:1px; padding-top:13px; border-top:1px solid #e4eae4; }
body.invoice-tool .paper-dates .paper-total-row { padding:2px 0; font-size:11.5px; }
body.invoice-tool .paper-total-row { display:flex; gap:10px; align-items:baseline; justify-content:space-between; padding:6px 0; }
body.invoice-tool .paper-total-row strong { font-variant-numeric:tabular-nums; text-align:right; }
body.invoice-tool .paper-items-table { width:100%; border-collapse:collapse; table-layout:fixed; line-height:1.43; }
body.invoice-tool .paper-items-table thead { display:table-header-group; }
body.invoice-tool .paper-items-table th { padding:11px 8px; border-bottom:2px solid var(--invoice-accent); color:var(--invoice-accent); background:var(--invoice-soft); font-size:11px; font-weight:800; text-align:right; }
body.invoice-tool .paper-items-table td { padding:11px 8px; border-bottom:1px solid #e8ede8; vertical-align:top; text-align:right; }
body.invoice-tool .paper-items-table th:nth-child(1),body.invoice-tool .paper-items-table td:nth-child(1) { width:6%; text-align:left; }
body.invoice-tool .paper-items-table th:nth-child(2),body.invoice-tool .paper-items-table td:nth-child(2) { width:42%; text-align:left; overflow-wrap:anywhere; }
body.invoice-tool .paper-items-table th:nth-child(3),body.invoice-tool .paper-items-table td:nth-child(3) { width:13%; }
body.invoice-tool .paper-items-table th:nth-child(4),body.invoice-tool .paper-items-table td:nth-child(4) { width:18%; }
body.invoice-tool .paper-items-table th:nth-child(5),body.invoice-tool .paper-items-table td:nth-child(5) { width:21%; }
body.invoice-tool .paper-empty-line { color:#9aa49a; text-align:center!important; font-style:italic; }
body.invoice-tool .paper-bottom-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,.9fr); gap:24px; align-items:start; margin-top:25px; }
body.invoice-tool .paper-payment-details { min-width:0; }
body.invoice-tool .paper-payment-details .paper-multiline { margin:7px 0 18px; }
body.invoice-tool .paper-totals { padding-top:6px; border-top:1px solid #cddacf; }
body.invoice-tool .paper-totals .paper-total-row { padding:6px 0; }
body.invoice-tool .paper-grand-total { margin-top:11px; padding:12px 0!important; border-top:2px solid var(--invoice-accent); color:var(--invoice-accent); font-size:15px; font-weight:850; }
body.invoice-tool .paper-grand-total strong { font-size:18px; }
body.invoice-tool .paper-footer { margin-top:68px; padding-top:16px; border-top:1px solid #e7ece7; color:#9ea69d; font-size:10px; text-align:center; }
body.invoice-tool .paper-warning { color:#a54838; font-weight:700; }
body.invoice-tool .inv-paper--modern .paper-header { margin:-10px -12px 32px; padding:22px 15px 27px; border-radius:10px; background:var(--invoice-soft); }
body.invoice-tool .inv-paper--minimal .paper-logo-placeholder { border:1px solid #e2e7e1; background:#fff; }
body.invoice-tool .inv-paper--minimal .paper-items-table th { background:#fff; }
@media(max-width:900px){
  body.invoice-tool .inv-grid--four { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.invoice-tool .inv-items-header { display:none; }
  body.invoice-tool .inv-item-row { grid-template-columns:minmax(0,2fr) minmax(90px,1fr) minmax(95px,1fr) 38px; }
  body.invoice-tool .inv-item-row .field:first-child { grid-column:1/-1; }
  body.invoice-tool .inv-item-row .inv-item-sum { grid-column:2/4; justify-content:flex-start; align-self:center; }
  body.invoice-tool .inv-remove-row { grid-column:4; grid-row:2; }
  body.invoice-tool .inv-row-label { display:block; color:#5a685b; font-size:11px; }
}
@media(max-width:630px){
  body.invoice-tool .app-shell { width:calc(100% - 24px); }
  body.invoice-tool .hero { padding-top:28px; }
  body.invoice-tool .tool-card { padding:14px; }
  body.invoice-tool .inv-grid--two { grid-template-columns:1fr; }
  body.invoice-tool .inv-section { padding:12px; }
  body.invoice-tool .inv-groups { gap:0; }
  body.invoice-tool .inv-item-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr) 40px; }
  body.invoice-tool .inv-item-row .field:first-child { grid-column:1/-1; }
  body.invoice-tool .inv-item-row .inv-item-sum { grid-column:1/3; grid-row:3; justify-content:flex-start; }
  body.invoice-tool .inv-item-row .inv-remove-row { grid-column:3; grid-row:2; }
  body.invoice-tool .inv-paper-surround { padding:8px; }
  body.invoice-tool .inv-paper { min-height:630px; padding:16px 13px; font-size:10px; }
  body.invoice-tool .paper-header { gap:9px; margin-bottom:21px; }
  body.invoice-tool .paper-logo { max-width:65px; max-height:45px; }
  body.invoice-tool .paper-brand { gap:8px; }
  body.invoice-tool .paper-company-name { font-size:11.5px; }
  body.invoice-tool .paper-logo-placeholder { width:44px; height:39px; font-size:10px; }
  body.invoice-tool .paper-doc-title { font-size:17px; }
  body.invoice-tool .paper-document-number { font-size:10px; }
  body.invoice-tool .paper-info-grid { gap:10px; margin-bottom:18px; }
  body.invoice-tool .paper-name { font-size:11px; }
  body.invoice-tool .paper-label { font-size:9px; letter-spacing:.5px; }
  body.invoice-tool .paper-items-table :where(th,td) { padding:8px 3px; font-size:9px; }
  body.invoice-tool .paper-bottom-grid { grid-template-columns:1fr; gap:14px; }
  body.invoice-tool .paper-totals { max-width:100%; }
  body.invoice-tool .paper-footer { margin-top:30px; }
  body.invoice-tool .footer { flex-wrap:wrap; }
}
@media(max-width:390px){ body.invoice-tool .inv-grid--four { grid-template-columns:1fr; } body.invoice-tool .inv-logo-actions { flex-wrap:wrap; } body.invoice-tool .inv-logo-actions button { flex:1; } body.invoice-tool .inv-summary > .inv-summary-total strong { font-size:17px; } }
@media print {
  @page { size:A4 portrait; margin:12mm; }
  html,body,body.invoice-tool { min-width:0!important; width:100%!important; margin:0!important; padding:0!important; background:white!important; color:#232c24!important; print-color-adjust:exact!important; -webkit-print-color-adjust:exact!important; }
  body.invoice-tool > .app-shell { display:contents!important; }
  body.invoice-tool .app-shell > :not(main),body.invoice-tool main > :not(#invoice-workspace) { display:none!important; }
  body.invoice-tool #invoice-workspace { display:contents!important; }
  body.invoice-tool #invoice-workspace > :not(#preview-section) { display:none!important; }
  body.invoice-tool #preview-section { display:contents!important; }
  body.invoice-tool #preview-section > :not(.inv-paper-surround) { display:none!important; }
  body.invoice-tool .inv-paper-surround { display:contents!important; }
  body.invoice-tool #invoice-paper { width:100%!important; max-width:none!important; min-height:0!important; margin:0!important; padding:0!important; overflow:visible!important; box-shadow:none!important; border:0!important; font-size:11pt!important; line-height:1.45!important; background:white!important; }
  body.invoice-tool .paper-doc-title { font-size:24pt!important; }
  body.invoice-tool .paper-company-name { font-size:14pt!important; }
  body.invoice-tool .paper-logo { max-width:105px!important; max-height:75px!important; }
  body.invoice-tool .paper-header { margin-bottom:28px!important; }
  body.invoice-tool .paper-info-grid { grid-template-columns:1fr 1fr!important; gap:20px!important; margin-bottom:23px!important; }
  body.invoice-tool .paper-bottom-grid { grid-template-columns:minmax(0,1fr) minmax(220px,.9fr)!important; gap:18px!important; }
  body.invoice-tool .paper-items-table th { background:var(--invoice-soft)!important; }
  body.invoice-tool .paper-items-table tr { break-inside:avoid; page-break-inside:avoid; }
  body.invoice-tool .paper-bottom-grid { break-inside:avoid; page-break-inside:avoid; }
  body.invoice-tool .paper-footer { margin-top:40px; }
  body.invoice-tool dialog { display:none!important; }
}

body.invoice-tool .inv-logo-actions { flex-wrap:wrap; }
body.invoice-tool .inv-logo-filename { flex-basis:100%; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }

/* US invoices use Letter; the Russian A4 print layout is retained. */
@page invoice-us-letter { size:letter portrait; margin:12mm; }
@media print { html[lang="en-US"] body.invoice-tool #invoice-paper { page:invoice-us-letter; } }
