    /* ============================================================
       EPAY W-3 CREATE PAGE — aligned to the W-2 master design.
       One style block. Field names, IDs and routes are unchanged.
       ============================================================ */

    .epay-w3-generator {
        --w3-navy: #023047;
        --w3-title: #062b45;
        --w3-text: #173f52;
        --w3-muted: #5f6f79;
        --w3-subtle: #71808a;
        --w3-teal: #0097b2;
        --w3-brand: #1a9ba8;
        --w3-brand-hover: #158793;
        --w3-hero-bg: #f4fbfc;
        --w3-surface: #ffffff;
        --w3-panel: #fbfdfe;
        --w3-input: #f6f9fb;
        --w3-border: #d9e3e8;
        --w3-border-input: #cfdbe1;
        --w3-border-soft: #dce5e9;
        --w3-danger: #c62828;
        --w3-success: #14804a;
        --w3-focus-ring: 0 0 0 3px rgba(0, 151, 178, 0.14);
        /* Same display font and hero alignment as the W-2 master. Change here only. */
        --w3-display-font: "Open Sans", sans-serif;
        --w3-hero-align: center;

        color: var(--w3-text);
        background: #ffffff;
        font-family: inherit;
    }

    .epay-w3-generator,
    .epay-w3-generator *,
    .epay-w3-generator *::before,
    .epay-w3-generator *::after {
        box-sizing: border-box;
    }

    .epay-w3-generator a,
    .epay-w3-generator button,
    .epay-w3-generator input,
    .epay-w3-generator select,
    .epay-w3-generator textarea {
        font-family: inherit;
    }

    /* One page scrollbar only. If the layout makes both <html> and <body>
       scroll containers, browsers show two scrollbars. "clip" still hides
       sideways overflow but does not create a second scroll area. */
    html,
    body {
        overflow-x: clip;
        overflow-y: visible;
    }

    /* Class display rules must never override the hidden attribute. */
    .epay-w3-generator [hidden] {
        display: none !important;
    }

    .epay-w3-generator .w3-visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .epay-w3-generator .w3-container {
        margin: 0 auto;
        width: 100%;
        max-width: 1220px;
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
        margin-left: auto;
        margin-right: auto;
    }

    /* ---------- Hero (W-2 master) ---------- */

    .epay-w3-generator .w3-hero {
        margin: 0;
        padding: 30px 0 24px;
        border: 0;
        background: var(--w3-hero-bg);
    }

    .epay-w3-generator .w3-hero-copy {
        width: 100%;
        max-width: 820px;
        margin: 0 auto;
        text-align: var(--w3-hero-align);
    }

    .epay-w3-generator .w3-hero h1 {
        margin: 0 0 10px;
        color: var(--w3-title);
        font-family: var(--w3-display-font);
        font-size: clamp(28px, 3.5vw, 40px);
        line-height: 1.2;
        font-weight: 700;
        letter-spacing: -0.8px;
    }

    .epay-w3-generator .w3-hero-description {
        max-width: 760px;
        margin: 0 auto 20px;
        color: #17384d;
        font-family: var(--w3-display-font);
        font-size: 17px;
        line-height: 1.65;
    }

    .epay-w3-generator .w3-hero-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 260px;
        min-height: 54px;
        padding: 14px 26px;
        border: 0;
        border-radius: 8px;
        background: var(--w3-brand);
        color: #ffffff;
        font-family: var(--w3-display-font);
        font-size: 16px;
        line-height: 1.2;
        font-weight: 700;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }

    .epay-w3-generator .w3-hero-cta:hover,
    .epay-w3-generator .w3-hero-cta:focus {
        background: var(--w3-brand-hover);
        color: #ffffff;
        text-decoration: none;
    }

    .epay-w3-generator .w3-hero-cta:focus-visible {
        outline: 3px solid rgba(26, 155, 168, 0.35);
        outline-offset: 2px;
    }

    .epay-w3-generator .w3-intro-note {
        margin: 16px 0 0;
        font-size: 14px;
        line-height: 1.6;
    }

    .epay-w3-generator .w3-intro-guide {
        max-width: 680px;
        margin: 24px auto 0;
        font-size: 14px;
        line-height: 1.65;
        text-align: left;
    }

    .epay-w3-generator .w3-intro-guide h2 {
        margin: 0 0 10px;
        color: var(--w3-navy);
        font-size: 20px;
        line-height: 1.35;
        font-weight: 700;
    }

    .epay-w3-generator .w3-intro-guide ol {
        margin: 0 0 12px;
        padding-left: 22px;
    }

    .epay-w3-generator .w3-intro-guide p {
        margin: 0;
    }

    /* ---------- Layout ---------- */

    .epay-w3-generator .w3-main {
        padding-top: 20px;
        padding-bottom: 64px;
    }

    .epay-w3-generator .w3-layout {
        align-items: start;
    }

    .epay-w3-generator .w3-form-column,
    .epay-w3-generator .w3-preview-column {
        min-width: 0;
    }

    .epay-w3-generator #w3GeneratorForm {
        scroll-margin-top: 100px;
    }

    /* ---------- Section cards ---------- */

    .epay-w3-generator .w3-section {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px 18px;
        margin-bottom: 24px;
        padding: 26px;
        border: 1px solid var(--w3-border);
        border-radius: 16px;
        background: var(--w3-surface);
        box-shadow: 0 10px 30px rgba(2, 48, 71, 0.07);
        position: relative;
    }

    .epay-w3-generator .w3-section-title {
        grid-column: 1 / -1;
        margin: 0 0 3px;
        padding: 0 0 14px;
        border-bottom: 2px solid #e8eef1;
        color: var(--w3-navy);
        font-size: 1.35rem;
        line-height: 1.35;
        font-weight: 800;
    }

    .epay-w3-generator .w3-full {
        grid-column: 1 / -1;
    }

    /* ---------- Fields ----------
       Each field shares its parent's rows (label / control / help),
       so controls in the same row always line up even when one label
       wraps or one field has help text. */

    .epay-w3-generator .w3-field {
        display: grid;
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: 0;
        align-content: start;
        min-width: 0;
    }

    @supports not (grid-template-rows: subgrid) {
        .epay-w3-generator .w3-field {
            display: flex;
            flex-direction: column;
            grid-row: auto;
        }
    }

    .epay-w3-generator .w3-field > label,
    .epay-w3-generator .w3-field-label {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        align-self: end;
        gap: 0 4px;
        margin: 0 0 5px;
        color: var(--w3-navy);
        font-size: 0.84rem;
        line-height: 1.38;
        font-weight: 600;
    }

    .epay-w3-generator .w3-required::after {
        content: "*";
        color: var(--w3-danger);
    }

    .epay-w3-generator .w3-optional {
        color: var(--w3-subtle);
        font-size: 0.72rem;
        font-weight: 400;
    }

    .epay-w3-generator .w3-control,
    .epay-w3-generator .w3-select,
    .epay-w3-generator .w3-textarea {
        display: block;
        width: 100%;
        min-height: 44px;
        padding: 9px 12px;
        border: 1px solid var(--w3-border-input);
        border-radius: 9px;
        background: var(--w3-input);
        color: var(--w3-navy);
        font-size: 0.9rem;
        line-height: 1.35;
        box-shadow: none;
        transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    }

    .epay-w3-generator .w3-control::placeholder,
    .epay-w3-generator .w3-textarea::placeholder {
        color: #86949d;
        opacity: 1;
    }

    .epay-w3-generator .w3-control:hover,
    .epay-w3-generator .w3-select:hover,
    .epay-w3-generator .w3-textarea:hover {
        border-color: #9bb4bf;
    }

    .epay-w3-generator .w3-control:focus,
    .epay-w3-generator .w3-select:focus,
    .epay-w3-generator .w3-textarea:focus {
        border-color: var(--w3-teal);
        background: #ffffff;
        outline: 0;
        box-shadow: var(--w3-focus-ring);
    }

    .epay-w3-generator .w3-control:disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

    .epay-w3-generator .w3-select-wrap {
        position: relative;
    }

    .epay-w3-generator .w3-select {
        padding-right: 42px;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: none;
        cursor: pointer;
    }

    .epay-w3-generator .w3-select-wrap::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 15px;
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--w3-navy);
        border-bottom: 2px solid var(--w3-navy);
        transform: translateY(-70%) rotate(45deg);
        pointer-events: none;
    }

    .epay-w3-generator .w3-textarea {
        min-height: 90px;
        resize: vertical;
    }

    .epay-w3-generator .w3-input-group {
        display: flex;
        align-items: stretch;
        width: 100%;
    }

    .epay-w3-generator .w3-input-prefix {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-width: 44px;
        padding: 0 11px;
        border: 1px solid var(--w3-border-input);
        border-right: 0;
        border-radius: 9px 0 0 9px;
        background: #e7eef2;
        color: var(--w3-navy);
        font-weight: 800;
    }

    .epay-w3-generator .w3-input-group .w3-control {
        min-width: 0;
        border-radius: 0 9px 9px 0;
    }

    .epay-w3-generator .w3-help {
        display: block;
        margin-top: 6px;
        color: var(--w3-muted);
        font-size: 0.74rem;
        line-height: 1.4;
    }

    .epay-w3-generator .w3-note {
        grid-column: 1 / -1;
        margin: -4px 0 0;
        color: var(--w3-muted);
        font-size: 0.8rem;
        line-height: 1.5;
    }

    /* ---------- Creation mode ---------- */

    .epay-w3-generator .w3-mode-options {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .epay-w3-generator .w3-mode-option {
        position: relative;
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin: 0;
        padding: 14px;
        border: 1px solid var(--w3-border-soft);
        border-radius: 10px;
        background: var(--w3-panel);
        cursor: pointer;
        transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    }

    .epay-w3-generator .w3-mode-option:hover {
        border-color: var(--w3-teal);
        background: #f4fbfc;
    }

    .epay-w3-generator .w3-mode-option.is-selected {
        border-color: var(--w3-teal);
        background: #edf9fb;
        box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.1);
    }

    .epay-w3-generator .w3-mode-option.is-focus-visible {
        box-shadow: var(--w3-focus-ring);
    }

    .epay-w3-generator .w3-mode-option input {
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
        margin: 1px 0 0;
        accent-color: var(--w3-teal);
    }

    .epay-w3-generator .w3-mode-option-copy strong,
    .epay-w3-generator .w3-mode-option-copy span {
        display: block;
    }

    .epay-w3-generator .w3-mode-option-copy strong {
        margin-bottom: 4px;
        color: var(--w3-navy);
        font-size: 0.88rem;
        line-height: 1.35;
        font-weight: 700;
    }

    .epay-w3-generator .w3-mode-option-copy span {
        color: var(--w3-muted);
        font-size: 0.76rem;
        line-height: 1.5;
    }

    /* ---------- Buttons ---------- */

    .epay-w3-generator .w3-lookup-actions {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .epay-w3-generator .w3-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        margin: 0;
        padding: 9px 16px;
        border-radius: 8px;
        font-size: 0.91rem;
        line-height: 1.2;
        font-weight: 700;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .epay-w3-generator .w3-btn:disabled {
        cursor: not-allowed;
        opacity: 0.65;
    }

    .epay-w3-generator .w3-btn:focus-visible {
        outline: 3px solid rgba(26, 155, 168, 0.35);
        outline-offset: 2px;
    }

    .epay-w3-generator .w3-btn-primary,
    .epay-w3-generator #submitW3Form {
        border: 0;
        background: var(--w3-brand);
        color: #ffffff;
        font-family: var(--w3-display-font);
        box-shadow: none;
    }

    .epay-w3-generator .w3-btn-primary:hover:not(:disabled),
    .epay-w3-generator #submitW3Form:hover:not(:disabled) {
        background: var(--w3-brand-hover);
        color: #ffffff;
    }

    .epay-w3-generator .w3-btn-secondary,
    .epay-w3-generator #generateW3Preview {
        border: 1px solid var(--w3-navy);
        border-radius: 11px;
        background: #ffffff;
        color: var(--w3-navy);
        font-weight: 800;
        box-shadow: none;
    }

    .epay-w3-generator .w3-btn-secondary:hover:not(:disabled),
    .epay-w3-generator #generateW3Preview:hover:not(:disabled) {
        background: #eef5f7;
        color: var(--w3-navy);
    }

    /* ---------- Status messages ---------- */

    .epay-w3-generator .w3-status {
        grid-column: 1 / -1;
        display: none;
        margin: 0;
        padding: 12px;
        border-radius: 8px;
        font-size: 0.84rem;
        line-height: 1.5;
    }

    .epay-w3-generator .w3-status.is-success {
        display: block;
        border: 1px solid #a7d8bd;
        background: #edf9f2;
        color: #17633b;
    }

    .epay-w3-generator .w3-status.is-error {
        display: block;
        border: 1px solid #b33b32;
        background: #fff7f6;
        color: #842029;
    }

    /* ---------- W-2 record selection ---------- */

    .epay-w3-generator .w3-results-toolbar {
        grid-column: 1 / -1;
        display: none;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 12px 13px;
        border: 1px solid var(--w3-border-soft);
        border-radius: 10px;
        background: var(--w3-panel);
    }

    .epay-w3-generator .w3-results-toolbar.is-visible {
        display: flex;
    }

    .epay-w3-generator .w3-results-summary {
        min-width: 0;
    }

    .epay-w3-generator .w3-results-summary strong {
        display: block;
        color: var(--w3-navy);
        font-size: 0.88rem;
        font-weight: 700;
    }

    .epay-w3-generator .w3-results-summary span {
        color: var(--w3-muted);
        font-size: 0.76rem;
    }

    .epay-w3-generator .w3-select-all {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        color: var(--w3-navy);
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
    }

    .epay-w3-generator .w3-select-all input,
    .epay-w3-generator .w3-record-check {
        width: 20px;
        height: 20px;
        margin: 0;
        accent-color: var(--w3-teal);
    }

    .epay-w3-generator .w3-records {
        grid-column: 1 / -1;
        display: grid;
        gap: 12px;
    }

    .epay-w3-generator .w3-record-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        margin: 0;
        padding: 14px;
        border: 1px solid var(--w3-border-soft);
        border-radius: 10px;
        background: #ffffff;
        transition: border-color 0.2s ease, background-color 0.2s ease;
    }

    .epay-w3-generator .w3-record-card:not(.is-disabled):not(.is-placeholder) {
        cursor: pointer;
    }

    .epay-w3-generator .w3-record-card:not(.is-disabled):not(.is-placeholder):hover {
        border-color: #9bb4bf;
    }

    .epay-w3-generator .w3-record-card.is-selected {
        border-color: var(--w3-teal);
        background: #f1fbfc;
        box-shadow: 0 0 0 2px rgba(0, 151, 178, 0.08);
    }

    .epay-w3-generator .w3-record-card.is-disabled {
        background: #f6f7f8;
        opacity: 0.75;
    }

    .epay-w3-generator .w3-record-card.is-placeholder {
        background: var(--w3-panel);
    }

    .epay-w3-generator .w3-record-card input {
        margin-top: 2px;
    }

    .epay-w3-generator .w3-record-card .w3-help {
        margin-top: 8px;
    }

    .epay-w3-generator .w3-record-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .epay-w3-generator .w3-record-body,
    .epay-w3-generator .w3-record-copy {
        display: block;
        min-width: 0;
    }

    .epay-w3-generator .w3-record-name {
        display: block;
        margin: 0;
        color: var(--w3-navy);
        font-size: 0.9rem;
        line-height: 1.4;
        font-weight: 700;
    }

    .epay-w3-generator .w3-record-meta {
        display: block;
        margin: 3px 0 0;
        color: var(--w3-muted);
        font-size: 0.76rem;
        line-height: 1.45;
    }

    .epay-w3-generator .w3-record-status {
        flex: 0 0 auto;
        padding: 4px 8px;
        border-radius: 999px;
        font-size: 0.7rem;
        font-weight: 700;
    }

    .epay-w3-generator .w3-record-status.is-ready {
        background: #e8f7ef;
        color: #17633b;
    }

    .epay-w3-generator .w3-record-status.is-missing {
        background: #fff0f0;
        color: #a32626;
    }

    .epay-w3-generator .w3-record-values {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 12px;
    }

    .epay-w3-generator .w3-record-value {
        min-width: 0;
        padding: 8px 9px;
        border-radius: 8px;
        background: #f5f8fa;
    }

    .epay-w3-generator .w3-record-value small {
        display: block;
        color: var(--w3-muted);
        font-size: 0.68rem;
        line-height: 1.35;
    }

    .epay-w3-generator .w3-record-value strong {
        display: block;
        margin-top: 2px;
        overflow: hidden;
        color: var(--w3-navy);
        font-size: 0.79rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ---------- Box 13 toggle (same look as W-2 option rows) ---------- */

    .epay-w3-generator .w3-toggle-card {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 52px;
        margin: 0;
        padding: 12px 13px;
        border: 1px solid var(--w3-border-soft);
        border-radius: 10px;
        background: var(--w3-panel);
        cursor: pointer;
    }

    .epay-w3-generator .w3-toggle-text {
        color: var(--w3-navy);
        font-size: 0.86rem;
        line-height: 1.4;
        font-weight: 600;
    }

    .epay-w3-generator .w3-toggle-text small {
        display: block;
        margin-top: 2px;
        color: var(--w3-muted);
        font-size: 0.74rem;
        font-weight: 400;
    }

    .epay-w3-generator .w3-switch {
        position: relative;
        display: inline-block;
        flex: 0 0 auto;
        width: 49px;
        height: 27px;
        margin: 0;
    }

    .epay-w3-generator .w3-switch input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    .epay-w3-generator .w3-slider {
        position: absolute;
        inset: 0;
        border-radius: 999px;
        background: #b8c5cb;
        cursor: pointer;
        transition: 0.22s ease;
    }

    .epay-w3-generator .w3-slider::before {
        content: "";
        position: absolute;
        left: 4px;
        bottom: 3px;
        width: 21px;
        height: 21px;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
        transition: 0.22s ease;
    }

    .epay-w3-generator .w3-switch input:checked + .w3-slider {
        background: var(--w3-teal);
    }

    .epay-w3-generator .w3-switch input:checked + .w3-slider::before {
        transform: translateX(20px);
    }

    .epay-w3-generator .w3-switch input:focus-visible + .w3-slider {
        box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.35);
    }

    /* ---------- Totals ---------- */

    .epay-w3-generator .w3-totals-grid {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .epay-w3-generator .w3-total-card {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        min-width: 0;
        padding: 12px;
        border: 1px solid var(--w3-border-soft);
        border-radius: 10px;
        background: var(--w3-panel);
    }

    .epay-w3-generator .w3-total-label {
        min-width: 0;
        color: var(--w3-muted);
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .epay-w3-generator .w3-total-value {
        flex: 0 0 auto;
        color: var(--w3-navy);
        font-size: 0.86rem;
        line-height: 1.35;
        font-weight: 800;
        text-align: right;
    }

    .epay-w3-generator .w3-manual-totals {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 18px;
        border: 1px solid #dbe7eb;
        border-radius: 12px;
        background: #f9fbfc;
    }

    .epay-w3-generator .w3-manual-note {
        grid-column: 1 / -1;
        margin: 0;
        color: var(--w3-muted);
        font-size: 0.8rem;
        line-height: 1.5;
    }

    /* ---------- Signature ---------- */

    .epay-w3-generator .w3-signature-wrap {
        grid-column: 1 / -1;
    }

    .epay-w3-generator .w3-signature-box {
        position: relative;
        overflow: hidden;
        width: 100%;
        min-height: 150px;
        border: 1px dashed #93aeb9;
        border-radius: 10px;
        background:
            repeating-linear-gradient(
                0deg,
                #ffffff,
                #ffffff 29px,
                #edf2f4 30px
            );
    }

    .epay-w3-generator #w3SignatureCanvas {
        display: block;
        width: 100%;
        height: 150px;
        touch-action: none;
        cursor: crosshair;
    }

    .epay-w3-generator .w3-signature-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 8px;
    }

    .epay-w3-generator .w3-signature-actions .w3-help {
        margin: 0;
    }

    .epay-w3-generator .w3-clear-signature {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 8px 12px;
        border: 1px solid var(--w3-border-input);
        border-radius: 8px;
        background: #ffffff;
        color: var(--w3-navy);
        font-size: 0.78rem;
        font-weight: 700;
        cursor: pointer;
    }

    .epay-w3-generator .w3-clear-signature:hover {
        background: #eef5f7;
    }

    /* ---------- Preview column (W-2 master) ---------- */

    .epay-w3-generator .w3-preview-column {
        position: sticky;
        top: 96px;
        align-self: start;
    }

    .epay-w3-generator .w3-preview-card {
        position: relative;
        width: 100%;
        padding: 22px;
        border: 1px solid var(--w3-border);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 14px 36px rgba(2, 48, 71, 0.1);
    }

    .epay-w3-generator .w3-preview-card h2 {
        margin: 0 0 5px;
        color: var(--w3-navy);
        text-align: center;
        font-size: 1.2rem;
        line-height: 1.35;
        font-weight: 800;
    }

    .epay-w3-generator .w3-preview-copy {
        margin: 0;
        color: var(--w3-muted);
        font-size: 0.82rem;
        line-height: 1.5;
        text-align: center;
    }

    .epay-w3-generator .w3-preview-copy.is-stale {
        color: #9a4a12;
        font-weight: 700;
    }

    .epay-w3-generator .w3-preview-badge {
        display: flex;
        width: fit-content;
        align-items: center;
        justify-content: center;
        margin: 8px auto 15px;
        padding: 5px 10px;
        border: 1px solid #c9dbe3;
        border-radius: 999px;
        background: #eef8fa;
        color: var(--w3-navy);
        font-size: 0.78rem;
        font-weight: 700;
    }

    .epay-w3-generator .w3-preview-frame {
        position: relative;
        width: 100%;
        height: clamp(420px, calc(100vh - 300px), 860px);
        overflow: hidden;
        border: 1px solid var(--w3-border-input);
        border-radius: 12px;
        background: #edf2f5;
    }

    .epay-w3-generator #w3PdfViewer {
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
        background: #ffffff;
    }

    /* Blank IRS sample shown until a preview is generated. */
    .epay-w3-generator .w3-preview-empty {
        position: absolute;
        inset: 0;
        display: block;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background: #ffffff;
    }

    .epay-w3-generator .w3-official-preview {
        display: block;
        width: 100%;
        max-width: none;
        height: auto;
        min-width: 0;
        min-height: 100%;
        margin: 0;
    }

    /* Fill the viewer width while keeping the IRS sample in its original ratio.
       Scrolling reveals the remaining page without stretching or cropping it. */
    .epay-w3-generator .w3-official-preview-image {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
    }

    .epay-w3-generator .w3-preview-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .epay-w3-generator .w3-preview-actions .w3-btn {
        width: 100%;
    }

    .epay-w3-generator .w3-action-status {
        margin-top: 14px;
        white-space: pre-line;
    }

    .epay-w3-generator .w3-pdf-link {
        display: block;
        margin: 12px 0 0;
        color: var(--w3-brand-hover);
        font-size: 0.82rem;
        font-weight: 700;
        text-align: center;
    }

    .epay-w3-generator .w3-loader {
        position: absolute;
        inset: 0;
        z-index: 5;
        display: none;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.82);
    }

    .epay-w3-generator .w3-loader.is-visible {
        display: flex;
    }

    .epay-w3-generator .w3-spinner {
        width: 44px;
        height: 44px;
        border: 4px solid #d9e6eb;
        border-top-color: var(--w3-teal);
        border-radius: 50%;
        animation: w3Spin 0.8s linear infinite;
    }

    @keyframes w3Spin {
        to { transform: rotate(360deg); }
    }

    /* ---------- Full preview modal ----------
       The modal is moved directly under <body> by the script (same as the
       W-2 master), so these rules use the modal ID, not the page wrapper. */

    #w3PreviewModal {
        position: fixed;
        inset: 0;
        z-index: 2147483647;
        display: none;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: clamp(16px, 4vw, 40px);
        overflow: auto;
        isolation: isolate;
        background: rgba(2, 48, 71, 0.72);
        font-family: inherit;
    }

    #w3PreviewModal.is-open {
        display: flex;
    }

    #w3PreviewModal,
    #w3PreviewModal * {
        box-sizing: border-box;
    }

    #w3PreviewModal .w3-modal-content {
        position: relative;
        width: min(900px, calc(100vw - 32px), calc((100vh - 64px) * 8.5 / 11));
        width: min(900px, calc(100vw - 32px), calc((100dvh - 64px) * 8.5 / 11));
        margin: auto;
        padding: 6px;
        border: 1px solid #cfdbe1;
        border-radius: 12px;
        background: #edf2f5;
        box-shadow: 0 16px 42px rgba(0, 18, 27, 0.24);
    }

    #w3PreviewModal .w3-modal-content:focus {
        outline: 0;
    }

    #w3PreviewModal #w3ModalPdf,
    #w3PreviewModal .w3-modal-sample {
        display: block;
        width: 100%;
        aspect-ratio: 8.5 / 11;
        border: 0;
        border-radius: 8px;
        background: #ffffff;
    }

    #w3PreviewModal .w3-modal-sample {
        height: auto;
        aspect-ratio: auto;
    }

    #w3PreviewModal [hidden] {
        display: none !important;
    }

    #w3PreviewModal .w3-modal-close {
        position: absolute;
        top: -16px;
        right: -16px;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border: 2px solid #ffffff;
        border-radius: 50%;
        background: #009bb5;
        color: #ffffff;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 5px 16px rgba(0, 18, 27, 0.24);
    }

    #w3PreviewModal .w3-modal-close:hover,
    #w3PreviewModal .w3-modal-close:focus-visible {
        background: #007f96;
        outline: 3px solid rgba(0, 155, 181, 0.28);
        outline-offset: 2px;
    }

    html.w3-modal-open,
    body.w3-modal-open {
        overflow: hidden;
    }

    /* ---------- Responsive ---------- */

    @media (max-width: 1199.98px) {
        .epay-w3-generator .w3-layout {
        }
    }

    @media (max-width: 991.98px) {
        .epay-w3-generator .w3-layout {
        }

        .epay-w3-generator .w3-preview-column {
            position: static;
        }

        .epay-w3-generator .w3-preview-frame {
            height: 680px;
        }
    }

    @media (max-width: 767.98px) {
        .epay-w3-generator .w3-hero {
            padding: 24px 0 18px;
        }

        .epay-w3-generator .w3-hero-description {
            margin-bottom: 18px;
            font-size: 16px;
        }

        .epay-w3-generator .w3-hero-cta {
            width: 100%;
            min-width: 0;
        }

        .epay-w3-generator .w3-main {
            padding-top: 14px;
            padding-bottom: 44px;
        }

        .epay-w3-generator .w3-section,
        .epay-w3-generator .w3-manual-totals,
        .epay-w3-generator .w3-mode-options,
        .epay-w3-generator .w3-totals-grid {
            grid-template-columns: minmax(0, 1fr);
        }

        .epay-w3-generator .w3-section {
            padding: 20px;
            border-radius: 14px;
        }

        .epay-w3-generator .w3-manual-totals {
            padding: 15px;
        }

        .epay-w3-generator .w3-section-title {
            font-size: 1.18rem;
        }

        .epay-w3-generator .w3-record-values {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .epay-w3-generator .w3-preview-frame {
            height: 620px;
        }

    }

    @media (max-width: 575.98px) {
        .epay-w3-generator .w3-main {
            padding-top: 14px;
            padding-bottom: 38px;
        }

        .epay-w3-generator .w3-section,
        .epay-w3-generator .w3-preview-card {
            padding: 16px;
        }

        .epay-w3-generator .w3-results-toolbar {
            align-items: flex-start;
            flex-direction: column;
        }

        .epay-w3-generator .w3-record-head {
            flex-direction: column;
        }

        .epay-w3-generator .w3-record-values {
            grid-template-columns: minmax(0, 1fr);
        }

        .epay-w3-generator .w3-preview-actions {
            grid-template-columns: minmax(0, 1fr);
        }

        .epay-w3-generator .w3-preview-frame {
            height: 540px;
        }

        #w3PreviewModal {
            padding: 12px;
        }

        #w3PreviewModal .w3-modal-content {
            width: min(calc(100vw - 24px), calc((100dvh - 32px) * 8.5 / 11));
            padding: 4px;
            border-radius: 10px;
        }

        #w3PreviewModal .w3-modal-close {
            top: -9px;
            right: -7px;
            width: 36px;
            height: 36px;
            font-size: 24px;
        }
    }

    /* W-3-only visual parity with the live 1099-MISC Create design, 2026-10-22.
       Existing fields, names, IDs, event handlers and PDF output are untouched. */
    .epay-w3-generator {
        --w3-navy: #062b45;
        --w3-teal: #1a9ba8;
        --w3-focus-ring: 0 0 0 3px rgba(26, 155, 168, .14);
    }
    .epay-w3-generator .w3-section {
        gap: 16px 18px;
        padding: 24px;
        border-radius: 16px;
    }
    .epay-w3-generator .w3-section-title {
        margin: 0;
        padding-bottom: 14px;
        font-size: 1.35rem;
        font-weight: 800;
        line-height: 1.35;
    }
    .epay-w3-generator .w3-field > label,
    .epay-w3-generator .w3-field-label {
        margin-bottom: 7px;
        color: var(--w3-navy);
        font-size: 15px;
        font-weight: 500;
        line-height: 18px;
    }
    /* Keep existing subgrid rows and textarea dimensions. */
    .epay-w3-generator .w3-control,
    .epay-w3-generator .w3-select {
        min-height: 46px;
        height: 46px;
        padding: 10px 12px;
        border-radius: 9px;
        font-size: 15px;
        font-weight: 400;
        line-height: 14px;
    }
    .epay-w3-generator .w3-textarea {
        min-height: 90px;
        padding: 10px 12px;
        font-size: 15px;
        font-weight: 400;
        line-height: 20px;
    }
    .epay-w3-generator .w3-mode-options { gap: 12px; }
    .epay-w3-generator .w3-mode-option { gap: 10px; padding: 14px; border-radius: 10px; }
    .epay-w3-generator .w3-mode-option input {
        width: 18px;
        height: 18px;
        accent-color: var(--w3-brand);
    }
    .epay-w3-generator .w3-mode-option-copy strong { font-size: 13px; line-height: 18px; }
    .epay-w3-generator .w3-mode-option-copy span { font-size: 12px; line-height: 1.5; }

    .epay-w3-generator .w3-btn,
    .epay-w3-generator .w3-preview-actions .w3-btn {
        min-height: 44px;
        height: 44px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.25;
    }
    .epay-w3-generator .w3-preview-actions {
        gap: 10px;
        max-width: 580px;
        margin: 30px auto 8px;
    }
    .epay-w3-generator .w3-preview-actions .w3-btn-secondary {
        border: 1px solid #7895a8;
        border-radius: 10px;
        background: #eaf2f6;
        color: var(--w3-navy);
        box-shadow: 0 1px 3px rgba(15, 50, 71, .14);
    }
    .epay-w3-generator .w3-preview-actions .w3-btn-secondary:hover:not(:disabled),
    .epay-w3-generator .w3-preview-actions .w3-btn-secondary:focus-visible {
        border-color: var(--w3-navy);
        background: #dceaf1;
    }
    .epay-w3-generator .w3-preview-actions .w3-btn-primary {
        border: 1px solid #168894;
        background: #1a9ba8;
        box-shadow: 0 1px 3px rgba(15, 50, 71, .18);
    }
    /* The viewer and its generated PDF remain unchanged. */
    .epay-w3-generator .w3-preview-card { padding: 12px; }
    .epay-w3-generator .w3-preview-frame {
        height: clamp(560px, calc(100vh - 220px), 940px);
        border-radius: 10px;
        background: #fff;
    }
    @media (max-width: 991.98px) {
        .epay-w3-generator .w3-preview-frame { height: clamp(540px, 72dvh, 760px); }
    }
    @media (max-width: 767.98px) {
        .epay-w3-generator .w3-section { padding: 20px; }
        .epay-w3-generator .w3-preview-frame { height: clamp(460px, 70dvh, 640px); }
    }
    @media (max-width: 575.98px) {
        .epay-w3-generator .w3-section,
        .epay-w3-generator .w3-preview-card { padding: 16px; }
        .epay-w3-generator .w3-preview-frame { height: clamp(420px, 68dvh, 560px); }
        .epay-w3-generator .w3-preview-actions {
            grid-template-columns: minmax(0, 1fr);
            gap: 10px;
            margin-top: 18px;
        }
    }
    /* The shared action partial uses !important and ID-level specificity.
       Override only W-3's two existing preview actions. */
    .epay-w3-generator .w3-preview-actions.epay-create-actions {
        gap: 10px !important;
        max-width: 580px;
        margin: 30px auto 8px !important;
    }
    .epay-w3-generator #generateW3Preview,
    .epay-w3-generator #submitW3Form {
        height: 44px !important;
        min-height: 44px !important;
        padding: 8px 12px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        line-height: 1.25 !important;
    }
    .epay-w3-generator #generateW3Preview {
        border: 1px solid #7895a8 !important;
        background: #eaf2f6 !important;
        color: var(--w3-navy) !important;
        box-shadow: 0 1px 3px rgba(15, 50, 71, .14) !important;
    }
    .epay-w3-generator #generateW3Preview:hover:not(:disabled),
    .epay-w3-generator #generateW3Preview:focus-visible {
        border-color: var(--w3-navy) !important;
        background: #dceaf1 !important;
    }
    .epay-w3-generator #submitW3Form {
        border: 1px solid #168894 !important;
        background: #1a9ba8 !important;
        color: #fff !important;
        box-shadow: 0 1px 3px rgba(15, 50, 71, .18) !important;
    }
    .epay-w3-generator #submitW3Form:hover:not(:disabled),
    .epay-w3-generator #submitW3Form:focus-visible {
        border-color: #137782 !important;
        background: #158793 !important;
    }
    @media (min-width: 576px) {
        .epay-w3-generator .w3-preview-actions.epay-create-actions {
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        }
    }
    @media (max-width: 575.98px) {
        .epay-w3-generator .w3-preview-actions.epay-create-actions {
            grid-template-columns: minmax(0, 1fr) !important;
            margin-top: 18px !important;
        }
    }

    /* W-3 blank-sample Full Preview only. The shared modal forces
       object-fit:contain + height:100%, leaving oversized side gutters.
       Let the IRS image fill the dialog horizontally and scroll vertically.
       The generated PDF iframe is intentionally unaffected. */
    body.epay-create-preview-standard
    #w3PreviewModal.epay-preview-standard-modal
    .w3-modal-content:has(#w3ModalSample:not([hidden])) {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.epay-create-preview-standard
    #w3PreviewModal.epay-preview-standard-modal
    .w3-modal-content:has(#w3ModalSample:not([hidden])) #w3ModalSample {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
        border-radius: 0;
    }

    /* Keep close control visible while scrolling down a full-size sample. */
    body.epay-create-preview-standard
    #w3PreviewModal.epay-preview-standard-modal
    .w3-modal-content:has(#w3ModalSample:not([hidden])) #closeW3Modal {
        position: sticky !important;
        top: 12px !important;
        right: 12px !important;
        margin: 0 12px -44px auto !important;
        flex: 0 0 44px !important;
        align-self: flex-end;
        z-index: 52 !important;
    }

    /* W-3 field system: match the approved W-2/941/1040 create controls. */
    .epay-w3-generator,
    .epay-w3-generator :is(input, select, textarea, button) {
        font-family: "Poppins", sans-serif;
    }

    .epay-w3-generator .w3-section {
        gap: 18px;
    }

    .epay-w3-generator .w3-section-title {
        color: #062b45;
        font-family: "Poppins", sans-serif;
        font-size: 22px;
        font-weight: 700;
        line-height: 1.35;
    }

    .epay-w3-generator .w3-field > label,
    .epay-w3-generator .w3-field-label {
        align-self: auto;
        margin: 0 0 8px;
        color: #062b45;
        font-family: "Poppins", sans-serif;
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;
    }

    /* Do not stretch one field's label to the wrapped-label height of its
       neighbor. Each label keeps the same 8px distance from its own control. */
    .epay-w3-generator .w3-field {
        display: flex;
        flex-direction: column;
        grid-row: auto;
        align-content: initial;
    }

    .epay-w3-generator .w3-required-suffix {
        white-space: nowrap;
    }
    .epay-w3-generator .w3-required-suffix > span {
        color: var(--w3-danger);
    }

    .epay-w3-generator .w3-control,
    .epay-w3-generator .w3-select {
        width: 100%;
        height: 46px;
        min-height: 46px;
        margin: 0;
        padding: 9px 12px;
        border: 1px solid #cfdbe1;
        border-radius: 9px;
        background: #f6f9fb;
        color: #062b45;
        font-size: 12.5px;
        font-weight: 400;
        line-height: 16.875px;
    }

    .epay-w3-generator .w3-select {
        padding-right: 42px;
    }

    .epay-w3-generator .w3-textarea {
        width: 100%;
        min-height: 90px;
        margin: 0;
        padding: 10px 12px;
        border: 1px solid #cfdbe1;
        border-radius: 9px;
        background: #f6f9fb;
        color: #062b45;
        font-size: 12.5px;
        font-weight: 400;
        line-height: 1.55;
    }

    .epay-w3-generator .w3-control::placeholder,
    .epay-w3-generator .w3-textarea::placeholder {
        color: #86949d;
        opacity: 1;
    }

    .epay-w3-generator .w3-input-prefix {
        min-width: 44px;
        height: 46px;
        min-height: 46px;
        border-color: #cfdbe1;
        background: #eef3f5;
        font-size: 12.5px;
    }

    .epay-w3-generator :is(.w3-help, .w3-note, .w3-manual-note) {
        color: #607785;
        font-family: "Poppins", sans-serif;
        font-size: 12px;
        line-height: 18px;
    }

    .epay-w3-generator .w3-help {
        margin-top: 6px;
    }

    .epay-w3-generator .w3-optional {
        color: #71808a;
        font-size: 12px;
        font-weight: 400;
        line-height: inherit;
    }

    .epay-w3-generator .w3-mode-option,
    .epay-w3-generator .w3-toggle-card {
        border-color: #cfdbe1;
        border-radius: 9px;
        background: #f7fafb;
    }

    .epay-w3-generator .w3-mode-option-copy strong,
    .epay-w3-generator .w3-toggle-text {
        color: #062b45;
        font-size: 14px;
        line-height: 20px;
    }

    .epay-w3-generator .w3-mode-option-copy span,
    .epay-w3-generator .w3-toggle-text small {
        font-size: 12px;
        line-height: 18px;
    }

    @media (max-width: 575.98px) {
        .epay-w3-generator .w3-section {
            gap: 18px;
        }

        .epay-w3-generator .w3-section-title {
            font-size: 21px;
        }
    }

    .epay-w3-generator .w-create-hero-standard[data-w-create-standard="1"] #w3PageTitle{
        font-family:"Poppins",sans-serif!important;
        font-size:32px!important;
        line-height:40px!important;
    }
    .epay-w3-generator #w3GeneratorForm .w3-field > label,
    .epay-w3-generator #w3GeneratorForm .w3-field-label{
        font-size:14px!important;
        font-weight:400!important;
        line-height:14px!important;
    }
    @media(min-width:768px) and (max-width:1023.98px){
        .epay-w3-generator .w-create-hero-standard[data-w-create-standard="1"] #w3PageTitle{font-size:30.72px!important;line-height:38.4px!important}
    }
@media(max-width:767.98px){
        .epay-w3-generator .w-create-hero-standard[data-w-create-standard="1"] #w3PageTitle{font-size:28px!important;line-height:35px!important}
}
.epay-w3-generator #w3GeneratorForm .w3-section-title{font-size:21.6px!important;font-weight:800!important;line-height:29.16px!important}
.epay-w3-generator #w3GeneratorForm .w3-section{padding:24px 26px!important;gap:18px!important}
.epay-w3-generator #w3GeneratorForm .w3-section{padding:24px 26px!important;gap:18px!important}
/* Container layout verified against Form 941; page-scoped, 2026-11-01. */
.epay-w3-generator .w3-layout{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,13fr);gap:24px;margin:0;width:100%;min-width:0;align-items:start;box-sizing:border-box}
.epay-w3-generator .w3-layout > *{width:100%;max-width:none;min-width:0;padding-left:0;padding-right:0;margin:0;box-sizing:border-box}
@media(min-width:992px) and (max-width:1199.98px){.epay-w3-generator .w3-layout{grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:22px}}
@media(max-width:991.98px){.epay-w3-generator .w3-layout{grid-template-columns:minmax(0,1fr);gap:24px}}
