.nec-main {
    --nec-navy: #062b45;
    --nec-teal: #1a9ba8;
    --nec-teal-dark: #158793;
    --nec-border: #d7e3e8;
    --nec-surface: #f6f9fb;
    --nec-muted: #667d89;
    padding: 28px 0 64px;
    background: #fff;
}

.nec-main *,
#pdfModal * {
    box-sizing: border-box;
}

.nec-main > .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;
}

.nec-layout-row {
    overflow: visible;
}

.nec-form-column,
.nec-preview-column {
    min-width: 0;
}

@media (min-width: 1200px) {
    .nec-layout-row {
    }

    .nec-layout-row > .nec-form-column,
    .nec-layout-row > .nec-preview-column {
        width: 100%;
        max-width: none;
        padding: 0;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .nec-layout-row {
    }

    .nec-layout-row > .nec-form-column,
    .nec-layout-row > .nec-preview-column {
        width: 100%;
        max-width: none;
        padding: 0;
    }
}

#pdfForm > .mb-4 {
    --nec-field-gap: 18px;
    --nec-label-gap: 7px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nec-field-gap);
    margin: 0 0 24px;
    padding: 24px 26px;
    border: 1px solid var(--nec-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(2, 48, 71, .07);
}

#pdfForm .form-section-title {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 0 14px;
    border-bottom: 2px solid #e8eef1;
    color: var(--nec-navy);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
}

#pdfForm .form-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nec-label-gap, 7px);
    width: 100%;
    min-width: 0;
}

#pdfForm .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: var(--nec-field-gap, 18px);
    margin: 0;
}

#pdfForm .row > [class*="col-"] {
    width: 100%;
    max-width: none;
    padding: 0;
}

#pdfForm .row > [class*="col-"] > .form-main {
    height: auto;
    align-self: start;
    align-content: start;
    justify-content: start;
}

/* The form column is narrow beside the live preview at desktop/tablet widths.
   Reserve the same two-line label area for every paired field so wrapped and
   single-line labels keep their controls on one baseline. */
@media (min-width: 992px) {
    #pdfForm .row > [class*="col-"] > .form-main > label:first-child {
        display: flex;
        min-height: 2.76em;
        align-items: flex-end;
    }
}

#pdfForm label,
#pdfForm .misc-mini-label {
    display: block;
    margin: 0;
    color: var(--nec-navy);
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.38;
}

#pdfForm .field-optional {
    color: #6b7f8b;
    font-size: .76rem;
    font-weight: 500;
    white-space: nowrap;
}

#pdfForm .form-control,
#pdfForm .form-select {
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #cfdbe1;
    border-radius: 9px;
    background: var(--nec-surface);
    color: var(--nec-navy);
    font-size: .9rem;
    line-height: 1.35;
    box-shadow: none;
}

#pdfForm .form-control:focus,
#pdfForm .form-select:focus {
    border-color: var(--nec-teal);
    background: #fff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(26, 155, 168, .14);
}

#pdfForm .input-group {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
}

#pdfForm .input-group-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 11px;
    border: 1px solid #cfdbe1;
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: #eef3f5;
    color: var(--nec-navy);
}

#pdfForm .input-group .form-control {
    border-radius: 0 9px 9px 0;
}

#pdfForm .checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #dce5e9;
    border-radius: 10px;
    background: #fbfdfe;
    color: #294b5b;
    cursor: pointer;
}

#pdfForm .checkbox-card input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--nec-teal);
}

#pdfForm .checkbox-card span {
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.45;
}

#pdfForm .field-help,
#pdfForm .year-note {
    margin: 0;
    color: var(--nec-muted);
    font-size: .78rem;
    line-height: 1.5;
    text-align: justify;
    text-justify: inter-word;
}

#pdfForm .ttoc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#pdfForm .ttoc-field {
    min-width: 0;
}

#pdfForm .ttoc-field .misc-mini-label {
    margin-bottom: 5px;
    color: #566f7d;
    font-size: .76rem;
}

#pdfForm .nec-2026-only[hidden],
#pdfForm .nec-egp-field[hidden],
#pdfForm #extraInputs[hidden] {
    display: none;
}

#pdfForm #extraInputs:not([hidden]) {
    display: grid;
    gap: var(--nec-field-gap, 18px);
}

.nec-form-errors {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #efbcbc;
    border-radius: 10px;
    background: #fff3f3;
    color: #8f2525;
    font-size: .84rem;
    line-height: 1.5;
}

.nec-form-errors ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

#pdfForm .is-invalid {
    border-color: #b42318;
    background: #fff;
}

.nec-preview-column {
    position: sticky;
    top: 96px;
    align-self: flex-start;
    height: fit-content;
}

.nec-preview-card {
    position: relative;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--nec-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(2, 48, 71, .1);
}

.nec-preview-heading {
    margin: 0 0 16px;
    text-align: center;
}

.nec-preview-heading h2 {
    margin: 0 0 5px;
    color: var(--nec-navy);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.35;
}

.nec-preview-heading p {
    margin: 0;
    color: var(--nec-muted);
    font-size: .82rem;
    line-height: 1.5;
}

.nec-year-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 5px 10px;
    border: 1px solid #c9dbe3;
    border-radius: 999px;
    background: #eef8fa;
    color: var(--nec-navy);
    font-size: .78rem;
    font-weight: 700;
}

#iframeWrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: clamp(560px, calc(100vh - 220px), 940px);
    min-height: 560px;
    max-height: 940px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #cfdbe1;
    border-radius: 10px;
    background: #fff;
}

#iframeWrapper iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    background: #fff;
}

#pdfViewer.nec-preview-hidden {
    display: none;
}

.nec-preview-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 580px;
    margin: 30px auto 8px;
}

.nec-preview-button,
.nec-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
}

.nec-preview-button {
    position: static;
    transform: none;
    border: 1px solid #7895a8;
    background: #eaf2f6;
    color: var(--nec-navy);
    box-shadow: 0 1px 3px rgba(15, 50, 71, .14);
}

.nec-preview-button:hover,
.nec-preview-button:focus {
    border-color: var(--nec-navy);
    background: #dceaf1;
    transform: translateY(-1px);
}

.nec-preview-button:disabled {
    border-color: #a8bac6;
    background: #edf2f5;
    color: #5e7483;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
    transform: none;
}

.nec-submit-button {
    border: 1px solid #168894;
    background: var(--nec-teal);
    color: #fff;
    box-shadow: 0 1px 3px rgba(15, 50, 71, .18);
}

.nec-submit-button:hover,
.nec-submit-button:focus {
    background: var(--nec-teal-dark);
    color: #fff;
    transform: none;
    box-shadow: none;
}

.nec-submit-button:disabled {
    cursor: progress;
    opacity: .68;
}

.loader-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .72);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #e8eff2;
    border-top-color: var(--nec-teal);
    border-radius: 50%;
    animation: necSpin .9s linear infinite;
}

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

html.nec-preview-open,
body.nec-preview-open {
    overflow: hidden;
}

#pdfModal {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 3vw, 28px);
    margin: 0;
    overflow: auto;
    isolation: isolate;
    background: rgba(6, 43, 69, .42);
}

#pdfModal .nec-modal-content {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(960px, 75vw, calc((100dvh - 56px) * 17 / 11));
    height: auto;
    aspect-ratio: 17 / 11;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d6e1e6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 18, 27, .16);
}

#pdfModal iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: auto;
    border: 0;
    border-radius: 7px;
    outline: 0;
    background: #fff;
}

#pdfModal .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d6e1e6;
    border-radius: 7px;
    background: #fff;
    color: #17384d;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,18,27,.14);
}

#pdfModal .close-btn:hover,
#pdfModal .close-btn:focus-visible {
    border-color: #9fb5c1;
    background: #f4f8fa;
    color: #062b45;
    outline: 2px solid rgba(0,155,181,.22);
    outline-offset: 1px;
}

@media (max-width: 991.98px) {
    .nec-preview-column {
        position: static;
        top: auto;
        height: auto;
    }

    #iframeWrapper { height:clamp(540px,72dvh,760px); min-height:0; max-height:760px; }
}

@media (max-width: 767.98px) {
    .nec-main {
        padding-top: 24px;
        padding-bottom: 44px;
    }

    #pdfForm > .mb-4 {
        padding: 20px;
        border-radius: 14px;
    }

    #pdfForm .row {
        grid-template-columns: minmax(0, 1fr);
    }

    .nec-preview-card {
        padding: 10px;
        border-radius: 14px;
    }

    #iframeWrapper { height:clamp(460px,70dvh,640px); min-height:0; max-height:640px; }

}

@media (max-width: 575.98px) {
    .nec-main > .container {
        width: 100%;
        max-width: 1220px;
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
        margin-left: auto;
        margin-right: auto;
    }

    #pdfForm > .mb-4 {
        padding: 16px;
    }

    .nec-preview-card {
        padding: 8px;
    }

    #iframeWrapper { height:clamp(420px,68dvh,560px); min-height:0; max-height:560px; }

    #pdfForm .ttoc-grid {
        grid-template-columns: minmax(0, 1fr);
    }

}

@media (max-width: 479.98px) {
    .nec-preview-actions {
        grid-template-columns: minmax(0, 1fr);
        max-width: 100%;
    }

    .nec-preview-button,
    .nec-submit-button {
        white-space: normal;
    }

}

/* Responsive 1099 PDF page renderer.
   PDF.js renders each generated page to the exact available width, so the
   preview never requires horizontal scrolling and the page ratio is preserved. */
#iframeWrapper {
    overflow-x: hidden !important;
    overflow-y: hidden;
}
.epay-1099-pdf-pages {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #eef3f5;
}
.epay-1099-pdf-pages--modal {
    height: 100%;
    padding: 6px;
    border-radius: 7px;
    background: #f7f9fa;
}
.epay-1099-pdf-page {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e1e8ec;
    box-shadow: none;
}
.epay-1099-pdf-page:last-child {
    margin-bottom: 0;
}
.epay-1099-pdf-page canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    margin: 0;
}
.epay-1099-pdf-page::before {
    content: "ePaystubs";
    position: absolute;
    left: 50%;
    z-index: 2;
    width: max-content;
    max-width: 90%;
    transform: translate(-50%, -50%) rotate(-28deg);
    color: rgba(2, 48, 71, .16);
    font-family: "Open Sans", sans-serif;
    font-size: clamp(24px, 4.2vw, 52px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .03em;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}
.epay-1099-pdf-page::before { top:50%; }
#pdfViewer.epay-1099-pdfjs-active,
#modalPdf.epay-1099-pdfjs-active {
    display: none !important;
}
@media (max-width: 575.98px) {
    .epay-1099-pdf-pages { padding: 5px; }
    .epay-1099-pdf-pages--modal { padding: 0; border-radius: 0; }
    .epay-1099-pdf-page { margin-bottom: 7px; }
    .epay-1099-pdf-page::before {
        font-size: clamp(22px, 8vw, 36px);
    }
}

/* Shared 1099 mobile/tablet preview hardening. Desktop proportions remain unchanged. */
@media (max-width:991.98px) {
    #iframeWrapper {
        width:100%;
        max-width:100%;
        height:clamp(540px,72dvh,760px);
        min-height:0;
        max-height:760px;
        overflow:auto;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
    }
    #iframeWrapper iframe {
        width:100%;
        max-width:100%;
        min-width:0;
        height:100%;
    }
    #pdfModal { padding:16px; }
    #pdfModal [role="dialog"] {
        width:min(720px,calc(100vw - 32px));
        max-width:100%;
        height:calc(100dvh - 32px);
        max-height:900px;
        aspect-ratio:auto;
    }
    #pdfModal .close-btn { top:8px; right:8px; }
}
@media (max-width:767.98px) {
    #iframeWrapper {
        height:clamp(460px,70dvh,640px);
        min-height:0;
        max-height:640px;
    }
    #pdfModal {
        align-items:stretch;
        padding:0;
    }
    #pdfModal [role="dialog"] {
        width:100%;
        max-width:100%;
        height:100dvh;
        max-height:none;
        margin:0;
        padding:0;
        border-radius:0;
    }
    #pdfModal iframe { border-radius:0; }
    #pdfModal .close-btn {
        top:8px;
        right:8px;
        width:38px;
        height:38px;
        font-size:24px;
    }
}
@media (max-width:575.98px) {
    #iframeWrapper {
        height:clamp(420px,68dvh,560px);
        min-height:0;
        max-height:560px;
    }
}

.nec-hero .tax1099-w2-intro ol,
.nec-hero .tax1099-w2-intro li {
    font-size: 13px;
    text-align: left;
}

/* Container layout verified against Form 941; page-scoped, 2026-11-01. */

.nec-layout-row{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}

.nec-layout-row > *{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){.nec-layout-row{grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:22px}}

@media(max-width:991.98px){.nec-layout-row{grid-template-columns:minmax(0,1fr);gap:24px}}
