.gen-container [hidden]{display:none!important}
:root{--g-ink:#1c2d45;--g-muted:#607088;--g-line:#dae3ed;--g-bg:#f6f8fb;--g-blue:#174976}*{box-sizing:border-box}body{margin:0;background:var(--g-bg);font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--g-ink)}.gen-container{width:min(1130px,calc(100% - 36px));margin:32px auto 70px}.gen-intro{margin:0 0 24px}.gen-intro h1{font-size:29px;font-weight:740;letter-spacing:-.035em;margin:5px 0}.gen-intro p{margin:7px 0 0;color:var(--g-muted);font-size:15px}.gen-kicker{font-size:11px!important;letter-spacing:.11em;font-weight:800;color:#346aa1!important}.gen-preview{display:inline-block;margin-top:10px;font-size:12px;color:#6c5a1a;background:#fef8e5;border:1px solid #e5d9ac;padding:5px 8px}.gen-form{display:flex;flex-direction:column;gap:16px}.gen-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}.gen-four{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.gen-panel{background:#fff;border:1px solid var(--g-line);padding:22px;border-radius:5px}.gen-panel h2{font-size:16px;font-weight:750;margin:0 0 18px;letter-spacing:-.01em}.gen-panel label{display:flex;flex-direction:column;gap:6px;margin-bottom:13px;font-size:12.5px;font-weight:600;color:#33455d;min-width:0}.gen-panel label span{display:block}.gen-panel input,.gen-panel select,.gen-panel textarea{width:100%;min-width:0;border:1px solid #cdd8e4;border-radius:3px;background:#fff;color:#14273d;padding:10px 11px;font:400 14px Inter,system-ui,Arial,sans-serif;min-height:39px}.gen-panel textarea{resize:vertical}.gen-panel input:focus,.gen-panel select:focus,.gen-panel textarea:focus{outline:2px solid #b8cfe9;outline-offset:0;border-color:#4781b5}.gen-hint{color:var(--g-muted);font-size:12px;line-height:1.5;margin:10px 0 0;font-weight:400}.gen-ref{max-width:300px}.gen-table-scroll{overflow-x:auto}.gen-table{border-collapse:collapse;width:100%;min-width:780px}.gen-table th{background:#f0f4f8;color:#53667f;font-size:11px;font-weight:750;text-align:left;padding:10px 8px;white-space:nowrap}.gen-table td{padding:8px 6px;border-bottom:1px solid #e6edf4;vertical-align:middle}.gen-table th:first-child{width:30px}.gen-table th:nth-child(2){width:37%}.gen-table th:last-child{width:38px}.gen-table input,.gen-table select{min-height:38px;padding:7px 8px;font-size:13px}.gen-table .gen-row-total{text-align:right;white-space:nowrap;font-weight:650;font-size:13px}.gen-secondary{border:1px solid #8faecb;background:#fff;color:#1d5687;font-weight:700;font-size:13px;padding:10px 15px;border-radius:3px;margin-top:14px;cursor:pointer}.gen-secondary:hover{background:#edf5fb}.gen-remove{width:29px;height:29px;background:#fff;border:1px solid #dae3ec;color:#9c4a4a;font-size:20px;cursor:pointer}.gen-totals{width:min(380px,100%);margin:20px 0 0 auto}.gen-totals>div{display:flex;justify-content:space-between;gap:15px;padding:9px 0;border-bottom:1px solid #e0e8f0;font-size:14px}.gen-totals .gen-total{font-size:18px;border-top:2px solid #264b73;border-bottom:0;margin-top:6px;font-weight:750}.gen-basis{margin-top:16px;max-width:650px}.gen-basis small{color:var(--g-muted);font-weight:400}.gen-submit{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:4px 0 0}.gen-submit>div{flex:1}.gen-error{color:#a42d34;font-weight:600;font-size:13px;margin:0}.gen-cta{margin-top:30px;border:1px solid #d6e1eb;background:#fff;padding:22px 25px;display:flex;justify-content:space-between;align-items:center;gap:15px}.gen-cta h2{font-size:17px;margin:0 0 6px}.gen-cta p{margin:0;color:var(--g-muted);font-size:13px}.gen-cta a{color:#1c5487;text-decoration:none;font-weight:700;font-size:13px;white-space:nowrap}.gen-cta a:hover{text-decoration:underline}@media(max-width:1050px){.gen-four{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:740px){.gen-container{margin-top:20px;width:calc(100% - 24px)}.gen-intro h1{font-size:24px}.gen-two,.gen-four{grid-template-columns:1fr}.gen-panel{padding:15px}.gen-cta,.gen-submit{align-items:stretch;flex-direction:column}.gen-cta a{white-space:normal}.gen-totals{width:100%}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* V7 — accounting-style invoice fields and two-way line discount controls. */
.gen-container{width:min(1360px,calc(100% - 36px))}
.gen-invoice-fields{grid-template-columns:1fr 1fr 1fr 1fr}
.gen-table{min-width:1150px}
.gen-table th:nth-child(1){width:3%}
.gen-table th:nth-child(2){width:29%}
.gen-table th:nth-child(3){width:8%}
.gen-table th:nth-child(4){width:11%}
.gen-table th:nth-child(5){width:10%}
.gen-table th:nth-child(6){width:12%}
.gen-table th:nth-child(7){width:8%}
.gen-table th:nth-child(8){width:14%}
.gen-table th:last-child{width:5%}
.gen-table .gen-discount-percent,.gen-table .gen-discount-amount{text-align:right;font-variant-numeric:tabular-nums}
.gen-table input:invalid{border-color:#ba5656;background:#fffafa}
.gen-discount-summary{color:#4b5f74}
@media(max-width:1060px){.gen-invoice-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:740px){.gen-invoice-fields{grid-template-columns:1fr}.gen-container{width:calc(100% - 24px)}}

/* V9 — neutral accounting surface, registry lookups only inside the closed pilot. */
.gen-container{--g-ink:#272d34;--g-muted:#5c636c;--g-line:#d9dbde;--g-bg:#f5f5f5;--g-blue:#424850}
.gen-container .gen-panel{border-color:#dbdde0;background:#fff}
.gen-container .gen-panel h2,.gen-container .gen-cta h2{color:#282f36}
.gen-container .gen-panel input,.gen-container .gen-panel select,.gen-container .gen-panel textarea{border-color:#cfd1d5;color:#252a31}
.gen-container .gen-panel input:focus,.gen-container .gen-panel select:focus,.gen-container .gen-panel textarea:focus{border-color:#737980;outline:2px solid #dadee1}
.gen-container .gen-table th{background:#ededee;color:#454d55}
.gen-container .gen-table td{border-bottom-color:#e5e5e5}
.gen-container .gen-totals .gen-total{border-top-color:#4d5258}
.gen-container .gen-secondary{border-color:#a4a7ab;color:#393f47}
.gen-container .gen-secondary:hover{background:#efefef}

.gen-container .gen-cta{border-color:#d8d8d8}
.gen-container .gen-cta a{color:#3c444d}
.gen-container .gen-kicker{color:#525a64!important}
.gen-registry{margin:0 0 15px;padding:10px 12px;border:1px solid #e1e1e1;background:#f7f7f7;border-radius:3px}
.gen-registry-controls{display:flex;gap:8px;align-items:stretch}
.gen-registry .gen-registry-query{flex:1;min-width:0;margin:0;min-height:38px}
.gen-registry-button{border:1px solid #aeb1b4;background:white;color:#2d343c;font:600 12px Inter,system-ui,sans-serif;padding:7px 10px;cursor:pointer;white-space:nowrap;border-radius:2px}
.gen-registry-button:disabled{opacity:.55;cursor:wait}
.gen-registry-msg{font-size:12px;color:#555c65;margin-top:6px}
.gen-registry-results{display:flex;flex-direction:column;gap:0;max-height:210px;overflow:auto}
.gen-registry-result{display:block;text-align:left;width:100%;border:0;border-bottom:1px solid #e2e2e2;background:#fff;padding:8px 9px;color:#252d33;cursor:pointer}
.gen-registry-result:hover,.gen-registry-result:focus{background:#eceeef}
.gen-registry-result small{display:block;color:#646a71;font-size:11px;margin-top:2px;overflow-wrap:anywhere}
@media(max-width:740px){.gen-registry-controls{flex-direction:column}.gen-registry-button{width:100%;white-space:normal}}

/* V9.2: readable, explicitly labeled invoice item fields on narrow screens. */
@media (max-width:1220px) {
 .gen-container .gen-table-scroll {overflow-x:visible}
 .gen-container .gen-table {display:block;width:100%;min-width:0;table-layout:auto}
 .gen-container .gen-table thead {display:none}
 .gen-container .gen-table tbody {display:block}
 .gen-container .gen-table tbody tr {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;border-bottom:1px solid #d9d9d9;padding:16px 0}
 .gen-container .gen-table tbody td {display:flex;flex-direction:column;justify-content:center;min-width:0;padding:0;border:0;text-align:left}
 .gen-container .gen-table tbody td::before {content:attr(data-label);font-size:12px;font-weight:650;color:#50565d;margin-bottom:5px;line-height:1.3}
 .gen-container .gen-table tbody td:nth-child(1) {grid-column:1 / -1;font-weight:700;font-size:13px;color:#42484f}
 .gen-container .gen-table tbody td:nth-child(1)::before,.gen-container .gen-table tbody td:nth-child(9)::before {display:none}
 .gen-container .gen-table tbody td:nth-child(2) {grid-column:1 / -1}
 .gen-container .gen-table tbody td:nth-child(8) {align-items:flex-start}
 .gen-container .gen-table tbody td:nth-child(9) {align-items:flex-end}
 .gen-container .gen-table tbody td input,.gen-container .gen-table tbody td select {width:100%;max-width:100%}
}
@media (max-width:420px) {
 .gen-container .gen-table tbody tr {gap:10px}
 .gen-container .gen-table tbody td:nth-child(8) {grid-column:1 / -1}
}

/* V9.3: payment terms and units. Keep the invoice table accessible on all screens. */
.gen-container .gen-invoice-fields{grid-template-columns:repeat(5,minmax(0,1fr))}
.gen-container .gen-table{min-width:1260px}
.gen-container .gen-table th:nth-child(1){width:3%}
.gen-container .gen-table th:nth-child(2){width:24%}
.gen-container .gen-table th:nth-child(3){width:8%}
.gen-container .gen-table th:nth-child(4){width:8%}
.gen-container .gen-table th:nth-child(5){width:11%}
.gen-container .gen-table th:nth-child(6){width:10%}
.gen-container .gen-table th:nth-child(7){width:12%}
.gen-container .gen-table th:nth-child(8){width:8%}
.gen-container .gen-table th:nth-child(9){width:12%}
.gen-container .gen-table th:nth-child(10){width:4%}
.gen-container .gen-table .gen-unit{min-width:55px}
@media(max-width:1180px){.gen-container .gen-invoice-fields{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:740px){.gen-container .gen-invoice-fields{grid-template-columns:1fr}}

/* V9.4: light accounting actions, fixed Euro currency and narrow-screen actions */
.gen-container .gen-invoice-fields{grid-template-columns:repeat(3,minmax(0,1fr))}
.gen-container .gen-invoice-fields input[readonly]{background:#f8f9fa;color:#43484e;cursor:default}

@media(max-width:1050px){.gen-container .gen-invoice-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:740px){.gen-container .gen-invoice-fields{grid-template-columns:1fr}}

/* V9.6 — single business-name input with autocomplete; compact discount fields. */
.gen-container .gen-registry{padding:10px 12px 12px}
.gen-container .gen-registry .gen-name-label{margin:0 0 6px;font-weight:650}
.gen-container .gen-registry .gen-registry-controls{align-items:stretch}
.gen-container .gen-registry .gen-registry-query{flex:1;min-width:0}
.gen-container .gen-registry .gen-registry-msg:empty{display:none}
.gen-container .gen-registry .gen-registry-results:empty{display:none}
.gen-container .gen-notes-counter{align-self:flex-end;color:#677078;font:400 11px Inter,system-ui,sans-serif}
@media(min-width:1221px){
 .gen-container .gen-table-scroll{overflow-x:visible}
 .gen-container .gen-table{min-width:0;width:100%;table-layout:fixed}
 .gen-container .gen-table th{white-space:normal;overflow-wrap:normal;hyphens:auto;line-height:1.25;padding:9px 4px;font-size:10.5px}
 .gen-container .gen-table td{padding:7px 3px}
 .gen-container .gen-table td input,.gen-container .gen-table td select{width:100%;min-width:0;max-width:100%;padding:7px 4px;font-size:12.5px}
 .gen-container .gen-table th:nth-child(1){width:3%}
 .gen-container .gen-table th:nth-child(2){width:26%}
 .gen-container .gen-table th:nth-child(3){width:7%}
 .gen-container .gen-table th:nth-child(4){width:7%}
 .gen-container .gen-table th:nth-child(5){width:11%}
 .gen-container .gen-table th:nth-child(6){width:7%}
 .gen-container .gen-table th:nth-child(7){width:10%}
 .gen-container .gen-table th:nth-child(8){width:9%}
 .gen-container .gen-table th:nth-child(9){width:15%}
 .gen-container .gen-table th:nth-child(10){width:5%}
 .gen-container .gen-table .gen-discount-percent{font-size:12px}
 .gen-container .gen-table .gen-discount-amount{font-size:12px}
 .gen-container .gen-table .gen-unit{min-width:0}
 .gen-container .gen-table .gen-row-total{font-size:12.5px;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:1220px){.gen-container .gen-table-scroll{overflow-x:visible}}
@media(max-width:740px){.gen-container .gen-registry-controls{flex-direction:column}}

/* V9.6: keep compact numerical columns and prevent horizontal scrollbar.
   At <=1220px the existing 2-column item cards replace the wide table. */
.gen-container .gen-registry .gen-registry-query {box-sizing:border-box}
@media(min-width:1221px){
 .gen-container .gen-table-scroll {overflow-x:clip}
 .gen-container .gen-table {min-width:0!important;table-layout:fixed;width:100%}
 .gen-container .gen-table th:nth-child(2) {width:28%}
 .gen-container .gen-table th:nth-child(6) {width:7%}
 .gen-container .gen-table th:nth-child(7) {width:9%}
 .gen-container .gen-table th:nth-child(9) {width:14%}
 .gen-container .gen-table th:nth-child(10) {width:4%}
 .gen-container .gen-table td {overflow:hidden}
 .gen-container .gen-table .gen-row-total {overflow-wrap:anywhere;white-space:normal}
}

/* Public generator UI: centered amount column, matching action toolbars. */
@media(min-width:1221px){
 .gen-container .gen-table th.gen-line-total-head,
 .gen-container .gen-table td.gen-row-total {text-align:center}
 .gen-container .gen-table td.gen-row-total {overflow-wrap:anywhere;word-break:normal;white-space:normal;font-variant-numeric:tabular-nums}
}

.gen-container .gen-file-icon{display:block;width:26px;height:28px;flex:0 0 26px}

@media(max-width:1220px){
 .gen-container .gen-table tbody td.gen-row-total {align-items:center;text-align:center}
}

.gen-container .gen-top-error{margin:0;font-size:13px}

/* Public generator V4: actionable, accessible form hints; not global styling. */
.gen-container .gen-field-error{display:block;color:#a13228;font-size:12px;line-height:1.4;margin-top:5px}
.gen-container .gen-field-advice{display:block;color:#82621a;font-size:12px;line-height:1.45;margin-top:5px}
.gen-container .gen-field-error[hidden],.gen-container .gen-field-advice[hidden]{display:none}
.gen-container .gen-input-invalid{border-color:#bc4939!important;outline:1px solid #bc4939;background:#fffafa}
.gen-container .gen-input-attention{border-color:#c3a04c!important;background:#fffdf5}

/* V5: restrained three-action toolbars and brand-color document pictograms.
   ARVETEHA_COMPACT_GENERATOR_ACTIONS_CLEAN_V2_20261022: edit in place; no override tail. */
.gen-container .gen-hero-row{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;min-width:0}
.gen-container .gen-hero-row .gen-intro{flex:1 1 370px;min-width:0;margin:0}
.gen-container .gen-hero-row .gen-top-actions{flex:0 1 auto;min-width:0;margin:0}
.gen-container .gen-top-actions .gen-actions{display:flex;justify-content:flex-end;align-items:center;flex-wrap:nowrap;gap:7px}
.gen-container .gen-submit>.gen-actions{flex:0 1 auto;min-width:0;display:flex;gap:7px;align-items:center;justify-content:flex-end;flex-wrap:nowrap}
.gen-container .gen-actions .gen-download{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;min-width:0;width:auto;padding:5px 9px;white-space:nowrap;background:#fff;border:1px solid #bdc3c9;color:#35424f;border-radius:2px;text-decoration:none;font:600 12px/1.2 Inter,system-ui,Arial,sans-serif;box-shadow:none;cursor:pointer}
.gen-container .gen-actions .gen-download:hover:not(:disabled){background:#f5f7f8;border-color:#9ca7b0;color:#263847}
.gen-container .gen-actions .gen-download:disabled{opacity:.65;cursor:wait}
.gen-container .gen-actions .gen-download:focus-visible{outline:2px solid #537496;outline-offset:2px}
.gen-container .gen-actions .gen-brand-file{flex:0 0 22px;width:22px;height:26px;display:block}
.gen-container .gen-actions .gen-brand-pdf{color:#d63c4e}
.gen-container .gen-actions .gen-brand-xml{color:#287e73}
.gen-container .gen-actions .gen-brand-digi{color:#326be6}
.gen-container .gen-actions .gen-action-text{display:inline;white-space:nowrap}
.gen-container .gen-actions .gen-arrow-icon,.gen-container .gen-actions .gen-external-icon{flex:0 0 13px;width:13px;height:13px;opacity:.7}
.gen-container .gen-submit>div:first-child{min-width:0;flex:1}
.gen-container .gen-reference-wrap{display:flex;align-items:flex-end;gap:10px;max-width:610px}
.gen-container .gen-reference-wrap .gen-ref{margin:0;flex:1 1 auto;min-width:0}
.gen-container .gen-reference-wrap .gen-ref input{min-height:43px}
@media(max-width:1270px){
 .gen-container .gen-hero-row{align-items:stretch;flex-direction:column;gap:14px}
 .gen-container .gen-hero-row .gen-intro{flex:0 0 auto}
 .gen-container .gen-hero-row .gen-top-actions{flex:0 0 auto;align-self:stretch}
 .gen-container .gen-top-actions .gen-actions{justify-content:flex-start;flex-wrap:wrap}
}
@media(max-width:960px){
 .gen-container .gen-submit{align-items:stretch;flex-direction:column}
 .gen-container .gen-submit>.gen-actions{width:100%;flex:0 0 auto;justify-content:flex-start;flex-wrap:wrap}
}
@media(max-width:740px){
 .gen-container .gen-top-actions .gen-actions,.gen-container .gen-submit>.gen-actions{width:100%;max-width:100%;min-width:0;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:nowrap;gap:8px}
 .gen-container .gen-actions .gen-download{position:relative;flex:0 0 44px;width:44px;max-width:44px;height:44px;min-height:44px;padding:7px;gap:0}
 .gen-container .gen-actions .gen-brand-file{flex:0 0 23px;width:23px;height:27px}
 .gen-container .gen-actions .gen-arrow-icon,.gen-container .gen-actions .gen-external-icon{display:none}
 .gen-container .gen-actions .gen-action-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
}

/* Arveteha mobile invoice lines V1 (2026-10-22):
   V9.3 sets a 1260px minimum width after V9.2's mobile card rules.
   Override ONLY on the narrow/card layout, keeping desktop unchanged. */
@media (max-width:1220px) {
  .gen-container .gen-table-scroll {
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:visible;
  }
  .gen-container .gen-table {
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    table-layout:auto;
  }
  .gen-container .gen-table tbody {
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
  }
  .gen-container .gen-table tbody tr {
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .gen-container .gen-table tbody td {
    box-sizing:border-box;
    min-width:0;
    max-width:100%;
    overflow-wrap:anywhere;
  }
  .gen-container .gen-table tbody td input,
  .gen-container .gen-table tbody td select {
    display:block;
    box-sizing:border-box;
    width:100%;
    min-width:0;
    max-width:100%;
  }
}
