* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    color: #111827;
    background: #fff;
}

button,
input,
textarea {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.loading {
    width: 450px;
    max-width: calc(100% - 32px);
    margin: 100px auto;
    padding: 42px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.loading h2 {
    font-size: 18px;
}

.loading p {
    font-size: 13px;
    color: #64748b;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: auto;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

.page {
    min-height: 100vh;
}

.confirm-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 48px;
    background: #f8fafc;
}

.confirm-card {
    width: 640px;
    max-width: 100%;
    padding: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
    text-align: center;
}

.confirm-card > span {
    display: block;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 13px;
    line-height: 20px;
}

.confirm-card h1 {
    margin: 0 0 16px;
    color: #111827;
    font-size: 24px;
    line-height: 32px;
}

.confirm-card > p {
    margin: 0 0 6px;
    color: #4b5563;
    font-size: 14px;
    line-height: 22px;
}

.confirm-notice {
    margin: 24px 0;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 13px;
    line-height: 21px;
    text-align: left;
}

.confirm-card .action {
    margin-top: 4px;
}

.confirm-card .action:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.order-page {
    width: 896px;
    max-width: 100%;
    margin: auto;
    padding: 0 16px 40px;
    background: #f8fafc;
}

.document {
    padding-top: 32px;
}

.paper-card,
.party-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 32px;
}

.po-head {
    padding: 24px 24px 15px;
}

.po-head h1 {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 32px;
}

.po-head .sub {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 28px;
}

.po-meta {
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.po-meta p {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 24px;
}

.po-meta p:last-child {
    margin-bottom: 0;
}

.party-card {
    border-color: #e5e7eb;
    overflow: hidden;
}

.party-toggle {
    width: 100%;
    min-height: 68px;
    padding: 20px;
    border: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
}

.party-toggle:hover {
    background: #f9fafb;
}

.party-toggle h2 {
    max-width: calc(100% - 32px);
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
}

.party-arrow {
    color: #6b7280;
}

.party-body {
    padding: 0 20px 20px;
}

.party-block {
    padding: 20px 16px 0;
}

.party-block + .party-block {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
}

@media (min-width: 601px) {
    .party-body {
        min-height: 625px;
    }
}

.party-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 20px;
}

.party-title > span {
    color: #111827;
    font-weight: 700;
}

.edit-link {
    padding: 0;
    border: 0;
    background: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.detail {
    margin-bottom: 12px;
}

.detail:last-child {
    margin-bottom: 0;
}

.detail-label {
    margin: 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 16px;
}

.detail-value {
    margin: 0;
    color: #111827;
    font-size: 14px;
    line-height: 20px;
}

.goods-card {
    padding: 24px;
    overflow: hidden;
}

.goods-card h3 {
    margin: 0 0 16px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
}

.table-wrap {
    overflow: hidden;
}

.goods {
    width: 100%;
    border-collapse: collapse;
    color: #111827;
    font-size: 14px;
    line-height: 20px;
}

.goods th,
.goods td {
    padding: 12px;
    border: 1px solid #d1d5db;
    text-align: left;
    vertical-align: middle;
}

.goods th {
    height: 73px;
    padding: 6px 12px;
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
}

.goods td {
    height: 45px;
}

.goods th:first-child,
.goods td:first-child {
    width: 44px;
    text-align: center;
}

.goods th:nth-child(2),
.goods td:nth-child(2) {
    width: auto;
}

.goods th:nth-child(3),
.goods td:nth-child(3),
.goods th:nth-child(4),
.goods td:nth-child(4) {
    width: 48px;
    text-align: center;
}

.goods th:last-child,
.goods td:last-child {
    width: 188px;
}

.goods tfoot td {
    height: 75px;
}

.total-label {
    text-align: right !important;
    font-weight: 600;
}

.total-price {
    font-weight: 600;
}

.rate {
    margin: 8px 0 16px;
    color: #6b7280;
    font-size: 12px;
    line-height: 17px;
}

.words {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 20px;
}

.bottom-action {
    padding: 0 16px 40px;
}

.action {
    display: block;
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.action:hover {
    background: #374151;
}

.terms-page {
    padding: 0 16px 48px;
    color: #4b5563;
}

.topline {
    height: 64px;
    display: flex;
    align-items: center;
}

.back {
    position: relative;
    top: 10px;
    width: 28px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: #64748b;
    cursor: pointer;
    font-size: 27px;
    line-height: 40px;
}

.terms-page .back {
    position: static;
    top: auto;
    padding: 1px 6px;
    font-size: 26px;
    line-height: normal;
}

.terms-page > h1 {
    margin: 16px 0 41px;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
}

.terms-content {
    padding: 0 25px;
    font-size: 14px;
    line-height: 22.75px;
}

.term-section {
    margin: 0 0 24px;
}

.term-head {
    min-height: 23px;
    margin: 0 0 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.term-head strong {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    line-height: 23px;
}

.term-text {
    padding-left: 12px;
    color: #4b5563;
    font-size: 14px;
    line-height: 22.75px;
}

.term-text p {
    margin: 0 0 8px;
}

.term-text p:last-child {
    margin-bottom: 0;
}

.term-value {
    color: #ef4444;
    font-weight: 500;
}

.term-value.accent {
    color: #16a34a;
}

.term-value.missing {
    color: #dc2626;
    font-weight: 700;
}

.divider {
    color: #9ca3af;
}

.terms-page > .action {
    margin-top: 32px;
}

.verify-page {
    width: 100%;
    max-width: 1024px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 12px 16px;
    background: #fff;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
}

.verify-titlebar {
    height: 52px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verify-titlebar .back {
    position: absolute;
    left: 0;
    top: -10px;
}

.verify-titlebar h1 {
    margin: 0;
    padding: 0 32px;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.verify-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    background: #fff;
    overflow: hidden;
}

.verify-intro {
    padding: 16px 16px 0;
}

.verify-intro h2 {
    margin: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.verify-intro p {
    margin: 4px 0 0;
    color: #4b5563;
    font-size: 12px;
    line-height: 20px;
}

.verify-main {
    min-height: 258px;
    margin: 12px 16px 16px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.code-line {
    display: block;
    margin: 0;
}

.code-line > div {
    width: 100%;
    text-align: left;
}

.verify-label {
    margin: 0;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.pairing-code {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 36px;
    margin: 4px 0 0;
    color: #374151;
    cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 30px;
    font-weight: 700;
    line-height: 36px;
    letter-spacing: 2px;
}

.pairing-code::after {
    content: "Tap to copy / 点击复制";
    margin-left: 18px;
    color: #9ca3af;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    letter-spacing: 0;
}

.message {
    min-height: 15px;
    margin: 0;
    color: #6b7280;
    font-size: 10px;
    line-height: 15px;
    text-transform: uppercase;
}

#edit-message {
    min-height: 20px;
    margin: 4px 0 0;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    text-transform: none;
}

#edit-message.ok {
    color: #15803d;
}

.pairing-time {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 16px;
    text-align: left;
}

.pairing-deadline {
    color: #dc2626;
    font-weight: 600;
}

.pairing-deadline strong {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 15px;
}

.send,
.resend-code {
    display: block;
    width: 100%;
    height: 38px;
    margin: 12px 0 0;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.send:disabled,
.resend-code:disabled {
    cursor: wait;
    opacity: .65;
}

.notice {
    margin: 8px 12px 0;
    color: #6b7280;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
}

.status-card,
.help-card {
    margin: 0;
    padding: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.status-card {
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 12px 12px;
}

.status-card h3,
.help-card h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.status-row {
    min-height: 59px;
    margin: 0 0 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.status-row:last-child {
    margin-bottom: 0;
}

.status-row p {
    margin: 0;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.status-row small {
    display: block;
    color: #6b7280;
    font-size: 11px;
    line-height: 17px;
}

.badge {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 11px;
    line-height: 15px;
}

.badge::before {
    content: "✓ ";
}

.badge.pending::before {
    content: "● ";
    color: #d1d5db;
}

.help-card {
    margin-top: 16px;
    border-radius: 12px;
    background: #f9fafb;
}

.help-step {
    min-height: 36px;
    margin: 0 0 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.help-step:last-child {
    margin-bottom: 0;
}

.help-step .num {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.help-step p {
    margin: 0;
    color: #111827;
    font-size: 12px;
    line-height: 18px;
}

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(2px);
}

.modal {
    width: 450px;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    overflow: auto;
    margin: 0;
    padding: 32px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .2);
}

.modal h3 {
    margin: 0 0 24px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
}

.modal .form-group {
    margin: 0 0 16px;
}

.modal .form-group label {
    display: block;
    margin: 0 0 8px;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.modal .field {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    line-height: 20px;
}

.modal textarea.field {
    height: 96px;
    resize: vertical;
}

.phone-editor {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
}

.country-picker {
    position: relative;
    width: 160px;
    min-width: 0;
}

.country-trigger {
    width: 100%;
    height: 42px;
    padding: 0 34px 0 12px;
    position: relative;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    cursor: pointer;
    text-align: left;
}

.country-trigger::after {
    content: '';
    position: absolute;
    right: 13px;
    top: 16px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #6b7280;
    border-bottom: 1.5px solid #6b7280;
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.country-picker.open .country-trigger {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.country-picker.open .country-trigger::after {
    top: 19px;
    transform: rotate(225deg);
}

.country-menu {
    width: 290px;
    max-width: min(290px, calc(100vw - 64px));
    max-height: 240px;
    overflow-y: auto;
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 35px rgba(15, 23, 42, .16);
    overscroll-behavior: contain;
}

.country-option {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #111827;
    cursor: pointer;
    text-align: left;
}

.country-option:hover,
.country-option:focus-visible {
    background: #f3f4f6;
    outline: none;
}

.country-option.selected {
    background: #eff6ff;
    color: #1d4ed8;
}

.country-code {
    flex: 0 0 52px;
    font-weight: 600;
}

.country-name {
    overflow: hidden;
    color: #4b5563;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.phone-editor input {
    width: 100%;
    min-width: 0;
}

.country-option-note {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 11px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.modal-actions button {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.modal-actions .cancel {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
}

.modal-actions .save {
    border: 0;
    background: #111827;
    color: #fff;
}

.dynamic-contract-page {
    min-height: 100vh;
    padding: 38px 18px 54px;
    background: #f1f4f6;
}

.dynamic-contract-document {
    width: min(980px, 100%);
    margin: 0 auto 28px;
}

.dynamic-contract-head,
.dynamic-contract-summary,
.dynamic-field-group,
.dynamic-contract-items,
.dynamic-contract-clauses,
.dynamic-contract-signatures {
    margin-bottom: 16px;
    padding: 26px 30px;
    border: 1px solid #e1e5e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(37, 48, 57, 0.05);
}

.dynamic-contract-head {
    position: relative;
    overflow: hidden;
    border-top: 5px solid #18bc9c;
}

.dynamic-contract-head::after {
    position: absolute;
    top: -80px;
    right: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(24, 188, 156, 0.07);
    content: "";
}

.dynamic-contract-head > span {
    color: #1688f1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dynamic-contract-head h1 {
    max-width: 760px;
    margin: 10px 0 7px;
    color: #24313b;
    font-size: 28px;
    line-height: 1.35;
}

.dynamic-contract-head > p {
    max-width: 760px;
    margin: 0;
    color: #76828b;
    line-height: 1.7;
}

.dynamic-contract-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 20px;
    color: #626f78;
    font-size: 13px;
}

.dynamic-contract-meta em {
    padding: 2px 8px;
    border-radius: 10px;
    background: #edf8f6;
    color: #15957d;
    font-style: normal;
}

.dynamic-contract-warning {
    width: min(980px, 100%);
    margin: 0 auto 16px;
    padding: 15px 18px;
    border: 1px solid #efc366;
    border-radius: 6px;
    background: #fff8e8;
    color: #7f5b12;
    line-height: 1.65;
}

.dynamic-contract-summary h2,
.dynamic-field-group h2,
.dynamic-contract-items h2,
.dynamic-contract-clauses > h2,
.dynamic-contract-signatures > h2 {
    margin: 0 0 16px;
    color: #2c3943;
    font-size: 17px;
}

.dynamic-contract-summary p {
    margin: 0;
    color: #53616b;
    line-height: 1.8;
    white-space: pre-wrap;
}

.dynamic-contract-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dynamic-field-group {
    margin: 0;
}

.dynamic-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.dynamic-group-head h2 {
    margin: 0;
}

.dynamic-group-head button {
    padding: 5px 10px;
    border: 1px solid #18bc9c;
    border-radius: 4px;
    background: #fff;
    color: #159a81;
}

.dynamic-group-description {
    margin: -4px 0 14px;
    color: #89939a;
    font-size: 12px;
}

.dynamic-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dynamic-field {
    min-width: 0;
}

.dynamic-field > span {
    display: block;
    margin-bottom: 4px;
    color: #9099a0;
    font-size: 11px;
}

.dynamic-field > p {
    margin: 0;
    color: #35424c;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.dynamic-field > p.missing {
    color: #e67e22;
}

.dynamic-contract-items {
    margin-top: 16px;
}

.dynamic-contract-items .table-wrap {
    overflow-x: auto;
}

.dynamic-contract-items table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
}

.dynamic-contract-items th,
.dynamic-contract-items td {
    padding: 10px 8px;
    border: 1px solid #e2e6e9;
    color: #46535d;
    font-size: 12px;
    text-align: left;
    vertical-align: top;
}

.dynamic-contract-items th {
    background: #f4f6f8;
    color: #68747d;
    white-space: nowrap;
}

.dynamic-contract-items td strong,
.dynamic-contract-items td small {
    display: block;
}

.dynamic-contract-items td small {
    margin-top: 4px;
    color: #818b93;
    line-height: 1.5;
}

.dynamic-contract-items tfoot td {
    background: #f3faf8;
    color: #28473f;
    font-weight: 700;
    text-align: right;
}

.dynamic-contract-clauses {
    margin-top: 16px;
}

.dynamic-contract-clauses article {
    padding: 18px 0;
    border-top: 1px solid #edf0f2;
}

.dynamic-contract-clauses article:first-child {
    padding-top: 0;
    border-top: 0;
}

.dynamic-contract-clauses article h3 {
    margin: 0 0 8px;
    color: #33414b;
    font-size: 14px;
}

.dynamic-contract-clauses article p {
    margin: 0;
    color: #55636d;
    line-height: 1.85;
}

.dynamic-contract-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.dynamic-contract-signatures > h2 {
    grid-column: 1 / -1;
}

.dynamic-contract-signatures > div {
    min-height: 105px;
    padding: 16px;
    border: 1px dashed #cdd4d9;
    border-radius: 5px;
}

.dynamic-contract-signatures p {
    margin: 0 0 12px;
    color: #4a5862;
}

/* The public contract is one continuous document. Modules remain data-driven,
   but their visual treatment follows a formal paper rather than dashboard cards. */
.dynamic-contract-document {
    padding: 0 46px 52px;
    overflow: hidden;
    border: 1px solid #dfe4e7;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(37, 48, 57, 0.08);
}

.dynamic-contract-head,
.dynamic-contract-summary,
.dynamic-field-group,
.dynamic-contract-items,
.dynamic-contract-clauses,
.dynamic-contract-signatures {
    margin: 0;
    padding: 28px 0;
    border: 0;
    border-bottom: 1px solid #e5e9ec;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.dynamic-contract-head {
    margin: 0 -46px;
    padding: 36px 46px 30px;
    border-top: 5px solid #18bc9c;
    border-bottom: 1px solid #e5e9ec;
}

.dynamic-contract-warning {
    width: auto;
    margin: 24px 0 0;
}

.dynamic-contract-summary {
    padding-top: 26px;
}

.dynamic-contract-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
}

.dynamic-field-group {
    grid-column: 1 / -1;
}

.dynamic-field-group:nth-child(1) {
    grid-column: 1;
}

.dynamic-field-group:nth-child(2) {
    grid-column: 2;
}

.dynamic-field-group:nth-child(1),
.dynamic-field-group:nth-child(2) {
    border-top: 0;
}

.dynamic-contract-items {
    margin-top: 0;
}

.dynamic-contract-clauses {
    margin-top: 0;
}

.dynamic-contract-signatures {
    margin-bottom: 0;
    border-bottom: 0;
}

@media (max-width: 760px) {
    .dynamic-contract-groups,
    .dynamic-field-grid,
    .dynamic-contract-signatures {
        grid-template-columns: 1fr;
    }

    .dynamic-contract-signatures > h2 {
        grid-column: auto;
    }

    .dynamic-field-group:nth-child(1),
    .dynamic-field-group:nth-child(2) {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .dynamic-contract-page {
        padding: 16px 10px 38px;
    }

    .dynamic-contract-document {
        padding: 0 18px 30px;
    }

    .dynamic-contract-head {
        margin: 0 -18px;
        padding: 26px 18px 22px;
    }

    .dynamic-contract-head,
    .dynamic-contract-summary,
    .dynamic-field-group,
    .dynamic-contract-items,
    .dynamic-contract-clauses,
    .dynamic-contract-signatures {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .dynamic-contract-head h1 {
        font-size: 22px;
    }

    .dynamic-contract-items .table-wrap {
        overflow-x: auto;
    }

    .order-page {
        padding: 0 16px 40px;
    }

    .document {
        padding-top: 32px;
    }

    .po-head h1 {
        font-size: 22px;
        line-height: 28px;
    }

    .po-head .sub {
        font-size: 17px;
        line-height: 28px;
    }

    .party-toggle {
        min-height: 96px;
        padding: 20px;
    }

    .party-toggle h2 {
        max-width: 304px;
    }

    .table-wrap {
        overflow: visible;
    }

    .goods {
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
        font-size: 11px;
    }

    .goods th,
    .goods td {
        height: auto;
        padding: 9px 4px;
        overflow-wrap: anywhere;
    }

    .goods th:first-child,
    .goods td:first-child {
        width: 10%;
    }

    .goods th:nth-child(2),
    .goods td:nth-child(2) {
        width: 31%;
    }

    .goods th:nth-child(3),
    .goods td:nth-child(3) {
        width: 12%;
    }

    .goods th:nth-child(4),
    .goods td:nth-child(4) {
        width: 12%;
    }

    .goods th:last-child,
    .goods td:last-child {
        width: 35%;
    }

    .bottom-action {
        padding: 0 32px 40px;
    }

    .terms-page {
        padding: 0 16px 48px;
    }

    .terms-content {
        padding: 0;
    }

    .term-head strong {
        max-width: calc(100% - 76px);
    }

    .verify-page {
        padding: 0 12px 16px;
    }

    .verify-main {
        margin: 12px 16px 16px;
        padding: 16px;
    }

    .pairing-code {
        font-size: 25px;
        letter-spacing: 1px;
    }

    .pairing-code::after {
        margin-left: 10px;
        font-size: 10px;
    }

    .status-row {
        align-items: center;
    }

    .badge {
        max-width: 150px;
        text-align: center;
    }

    .modal {
        padding: 24px;
    }

    .modal-actions {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .phone-editor {
        grid-template-columns: 135px minmax(0, 1fr);
    }

    .country-picker {
        width: 135px;
    }

    .country-menu {
        width: 260px;
    }
}

/* Modular templates use the procurement contract's visual system. The
   template data can change by business, but the public document shell stays
   familiar and credible across every contract type. */
.dynamic-contract-page {
    min-height: 100vh;
    padding: 0 16px 40px;
    background: #f8fafc;
    color: #4b5563;
}

.dynamic-contract-document {
    width: auto;
    margin: 0;
    padding: 32px 0 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.dynamic-contract-head {
    position: static;
    margin: 0 0 32px;
    padding: 24px 24px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.dynamic-contract-head::after {
    display: none;
}

.dynamic-contract-head > span {
    display: block;
    margin: 0 0 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}

.dynamic-contract-head h1 {
    max-width: none;
    margin: 0 0 4px;
    color: #111827;
    font-size: 26px;
    line-height: 32px;
}

.dynamic-contract-head .sub {
    max-width: none;
    margin: 0 0 12px;
    color: #111827;
    font-size: 18px;
    line-height: 28px;
}

.dynamic-contract-meta {
    display: block;
    margin: 0;
    color: #111827;
    font-size: 16px;
}

.dynamic-contract-meta p {
    margin: 0 0 8px;
    color: #111827;
    font-size: 16px;
    line-height: 24px;
}

.dynamic-contract-meta p:last-child {
    margin-bottom: 0;
}

.dynamic-contract-meta em {
    padding: 0;
    border-radius: 0;
    background: none;
    color: #6b7280;
    font-style: normal;
}

.dynamic-contract-warning {
    width: auto;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 14px;
    line-height: 22px;
}

.dynamic-contract-summary,
.dynamic-contract-items,
.dynamic-contract-clauses,
.dynamic-contract-signatures {
    margin: 0 0 32px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.dynamic-contract-summary h3,
.dynamic-contract-items h3,
.dynamic-contract-clauses h3,
.dynamic-contract-signatures h3 {
    margin: 0 0 16px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
}

.dynamic-contract-summary p {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 22.75px;
    white-space: pre-wrap;
}

.dynamic-contract-groups {
    display: block;
    margin: 0 0 32px;
    padding: 0 20px 20px;
    border-color: #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.dynamic-field-group {
    margin: 0;
}

.dynamic-group-head {
    margin-bottom: 16px;
}

.dynamic-group-head h2 {
    margin: 0;
}

.dynamic-group-head button {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.dynamic-group-description {
    margin: -4px 0 14px;
    color: #6b7280;
    font-size: 12px;
    line-height: 17px;
}

.dynamic-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dynamic-field {
    min-width: 0;
    margin-bottom: 0;
}

.dynamic-field > span.detail-label {
    display: block;
    margin: 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 16px;
}

.dynamic-field > p.detail-value {
    margin: 0;
    color: #111827;
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.dynamic-field > p.detail-value.missing {
    color: #dc2626;
    font-weight: 700;
}

.dynamic-contract-items .table-wrap {
    overflow-x: auto;
}

.dynamic-contract-items .dynamic-goods {
    min-width: 760px;
    table-layout: auto;
}

.dynamic-contract-items .dynamic-goods th,
.dynamic-contract-items .dynamic-goods td {
    vertical-align: middle;
}

.dynamic-contract-items .dynamic-goods th:first-child,
.dynamic-contract-items .dynamic-goods td:first-child {
    width: 44px;
}

.dynamic-contract-items .dynamic-goods th:nth-child(2),
.dynamic-contract-items .dynamic-goods td:nth-child(2) {
    width: 100px;
}

.dynamic-contract-items .dynamic-goods th:nth-child(3),
.dynamic-contract-items .dynamic-goods td:nth-child(3) {
    width: auto;
    text-align: left;
}

.dynamic-contract-items .dynamic-goods th:nth-child(4),
.dynamic-contract-items .dynamic-goods td:nth-child(4),
.dynamic-contract-items .dynamic-goods th:nth-child(5),
.dynamic-contract-items .dynamic-goods td:nth-child(5),
.dynamic-contract-items .dynamic-goods th:nth-child(6),
.dynamic-contract-items .dynamic-goods td:nth-child(6) {
    width: 58px;
    text-align: center;
}

.dynamic-contract-items .dynamic-goods th:nth-child(7),
.dynamic-contract-items .dynamic-goods td:nth-child(7),
.dynamic-contract-items .dynamic-goods th:nth-child(8),
.dynamic-contract-items .dynamic-goods td:nth-child(8) {
    width: 112px;
}

.dynamic-contract-items .dynamic-goods td strong,
.dynamic-contract-items .dynamic-goods td small {
    display: block;
}

.dynamic-contract-items .dynamic-goods td small {
    margin-top: 4px;
    color: #6b7280;
    line-height: 20px;
}

.dynamic-contract-clauses article {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.dynamic-contract-clauses article:last-child {
    margin-bottom: 0;
}

.dynamic-contract-clauses article h3 {
    margin: 0 0 12px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    line-height: 23px;
}

.dynamic-contract-clauses article p {
    margin: 0;
    padding-left: 12px;
    color: #4b5563;
    font-size: 14px;
    line-height: 22.75px;
    white-space: pre-wrap;
}

.dynamic-contract-signatures {
    margin-bottom: 0;
}

.dynamic-signature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dynamic-signature-grid > div {
    min-height: 0;
    padding: 20px 16px 0;
    border: 0;
}

.dynamic-signature-grid > div + div {
    border-left: 1px solid #e5e7eb;
}

.dynamic-signature-grid p {
    margin: 0;
}

@media (max-width: 760px) {
    .dynamic-field-grid,
    .dynamic-signature-grid {
        grid-template-columns: 1fr;
    }

    .dynamic-signature-grid > div + div {
        padding-top: 16px;
        border-top: 1px solid #e5e7eb;
        border-left: 0;
    }
}

@media (max-width: 600px) {
    .dynamic-contract-page {
        padding: 0 16px 40px;
    }

    .dynamic-contract-document {
        padding-top: 32px;
    }

    .dynamic-contract-head {
        margin-bottom: 32px;
        padding: 24px 20px 15px;
    }

    .dynamic-contract-head h1 {
        font-size: 22px;
        line-height: 28px;
    }

    .dynamic-contract-head .sub {
        font-size: 17px;
        line-height: 28px;
    }

    .dynamic-contract-summary,
    .dynamic-contract-items,
    .dynamic-contract-clauses,
    .dynamic-contract-signatures {
        padding: 20px;
    }

    .dynamic-contract-groups {
        padding: 0 20px 20px;
    }

    .dynamic-contract-items .dynamic-goods {
        min-width: 760px;
    }
}

.seller-note-section {
    border: 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    background: transparent;
}

.seller-note-section h3,
.seller-note-section .term-head strong {
    color: #374151;
}

.seller-note-section p {
    color: #4b5563;
    white-space: pre-wrap;
}

.seller-note-input {
    width: 100%;
    min-height: 96px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 22px;
    resize: vertical;
}

.seller-note-input:focus {
    border-color: #2563eb;
    outline: 2px solid rgba(37, 99, 235, .14);
    outline-offset: 1px;
}

.seller-note-input[readonly] {
    background: #f8fafc;
}

.seller-note-actions {
    min-height: 30px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.seller-note-status {
    margin-right: auto;
    color: #64748b;
    font-size: 12px;
    line-height: 20px;
}

.seller-note-save {
    min-width: 112px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
}

.seller-note-save:hover:not(:disabled) {
    background: #f8fafc;
}

.seller-note-save:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.terms-content .seller-note-section {
    margin: 24px 0 32px;
    padding: 16px 18px;
}

.terms-content .seller-note-section .term-head {
    margin-bottom: 8px;
}

.terms-content .seller-note-section .term-text {
    padding-left: 0;
    color: #78350f;
}

.dynamic-contract-page .seller-note-section {
    margin: 24px 0 32px;
    padding: 24px;
}

.dynamic-contract-page .seller-note-section h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
}

.dynamic-contract-page .seller-note-section p {
    margin: 0;
    font-size: 14px;
    line-height: 22.75px;
}

@media (max-width: 600px) {
    .dynamic-contract-page .seller-note-section {
        padding: 20px;
    }
}

/* Membership registration is a public form rather than a long-form contract. */
.dynamic-contract-page.membership-template-page {
    width: 896px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px 40px;
    background: #f8fafc;
    color: #111827;
}

.membership-template-page .dynamic-contract-document {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 32px 0 0;
}

.membership-template-page .dynamic-contract-head {
    margin: 0 0 32px;
    padding: 24px 24px 15px;
    border: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
    text-align: left;
}

.membership-template-page .dynamic-contract-head > span,
.membership-template-page .dynamic-contract-head .dynamic-contract-meta {
    display: none;
}

.membership-template-page .dynamic-contract-head h1 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 26px;
    line-height: 32px;
}

.membership-template-page .dynamic-contract-head .sub {
    display: none;
}

.membership-template-page .dynamic-contract-groups {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.membership-registration-form {
    margin: 0 0 32px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}

.membership-merchant-heading {
    margin: 0 0 24px;
    padding: 0 0 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.membership-merchant-heading > span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 12px;
    line-height: 18px;
}

.membership-merchant-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    line-height: 28px;
    overflow-wrap: anywhere;
}

.membership-offer-heading {
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    text-align: left;
}

.membership-offer-heading h2 {
    margin: 0 0 7px;
    color: #111827;
    font-size: 18px;
    line-height: 28px;
}

.membership-offer-heading p {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    overflow-wrap: anywhere;
}

.membership-deadline {
    margin: 0 0 24px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
}

.membership-deadline span {
    color: #6b7280;
    font-size: 13px;
    line-height: 20px;
}

.membership-deadline strong {
    color: #374151;
    font-size: 14px;
    line-height: 20px;
    text-align: right;
}

.membership-field {
    display: block;
    margin: 0 0 18px;
}

.membership-field > span {
    display: block;
    margin: 0 0 7px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.membership-field input,
.membership-field select,
.membership-phone-field select,
.membership-phone-field input {
    width: 100%;
    min-width: 0;
    height: 45px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    line-height: 22px;
}

.membership-field input:focus,
.membership-field select:focus,
.membership-phone-field select:focus,
.membership-phone-field input:focus {
    border-color: #2563eb;
    outline: 2px solid rgba(37, 99, 235, .14);
    outline-offset: 1px;
}

.membership-phone-field {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 8px;
}

.membership-whatsapp-reason {
    margin: 2px 0 24px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.membership-whatsapp-reason p {
    margin: 0 0 9px;
    color: #4b5563;
    font-size: 12px;
    line-height: 19px;
}

.membership-whatsapp-reason p:last-child {
    margin-bottom: 0;
}

.membership-whatsapp-reason .membership-reason-title {
    margin-bottom: 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.membership-link-note {
    margin: 0 0 15px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.membership-consent {
    margin: 0 0 16px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #374151;
    font-size: 13px;
    line-height: 20px;
}

.membership-consent input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    accent-color: #2563eb;
}

.membership-submit {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 24px;
    box-shadow: none;
}

.membership-submit:hover:not(:disabled) {
    background: #374151;
}

.membership-submit:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.membership-registration-form > #membership-form-message {
    min-height: 20px;
    margin: 9px 0 0;
    color: #b91c1c;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    text-transform: none;
}

.membership-registration-form > #membership-form-message.ok {
    color: #15803d;
}

.membership-privacy {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 11px;
    line-height: 18px;
}

.membership-pdf-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

.membership-pdf-field {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.membership-pdf-field span {
    display: block;
    margin: 0 0 5px;
    color: #6b7280;
    font-size: 12px;
    line-height: 18px;
}

.membership-pdf-field strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    line-height: 21px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.membership-consent-static {
    margin: 0 0 16px;
    color: #374151;
    font-size: 13px;
    line-height: 20px;
}

.pdf-note-value {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 22.75px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pdf-contract-action {
    display: none;
}

.verify-page.membership-verification-page {
    max-width: 1024px;
    padding: 0 12px 16px;
    background: #fff;
}

.membership-verification-page .verify-titlebar {
    margin-bottom: 0;
}

.membership-verification-page .verify-titlebar h1 {
    color: #111827;
    font-size: 16px;
    line-height: 20px;
}

.membership-verification-page .verify-card,
.membership-verification-page .status-card,
.membership-verification-page .help-card,
.membership-verification-page .membership-verify-reasons {
    border-color: #e5e7eb;
    box-shadow: none;
}

.membership-verification-page .verify-card {
    border-radius: 12px 12px 0 0;
}

.membership-verification-page .verify-intro h2 {
    font-size: 14px;
    line-height: 20px;
}

.membership-verification-page .pairing-code {
    color: #374151;
}

.membership-verification-page .membership-verify-reasons {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.membership-verify-reasons article {
    margin: 0 0 18px;
}

.membership-verify-reasons article:last-child {
    margin-bottom: 0;
}

.membership-verify-reasons h3 {
    margin: 0 0 7px;
    color: #374151;
    font-size: 13px;
    line-height: 20px;
}

.membership-verify-reasons p {
    margin: 0;
    color: #4b5563;
    font-size: 12px;
    line-height: 19px;
    white-space: pre-wrap;
}

.membership-verification-page #signed-box {
    border-radius: 16px;
}

@media (max-width: 600px) {
    .membership-template-page .dynamic-contract-document {
        padding-top: 32px;
    }

    .membership-template-page .dynamic-contract-head h1 {
        font-size: 22px;
        line-height: 29px;
    }

    .membership-registration-form {
        padding: 24px 20px 20px;
        border-radius: 12px;
    }

    .membership-phone-field {
        grid-template-columns: 135px minmax(0, 1fr);
    }

    .membership-deadline {
        display: block;
    }

    .membership-deadline span,
    .membership-deadline strong {
        display: block;
        text-align: left;
    }

    .membership-deadline strong {
        margin-top: 4px;
    }
}

@page {
    size: A4;
    margin: 12mm;
}

@media print {
    html,
    body,
    body.pdf-mode {
        min-width: 0;
        background: #fff !important;
    }

    body.pdf-mode {
        color: #111827;
    }

    body.pdf-mode #loading,
    body.pdf-mode #error,
    body.pdf-mode #verify-page,
    body.pdf-mode #confirm-page,
    body.pdf-mode #modal-mask,
    body.pdf-mode .edit-link,
    body.pdf-mode .bottom-action,
    body.pdf-mode .topline,
    body.pdf-mode .terms-page > .action,
    body.pdf-mode .seller-note-actions,
    body.pdf-mode .seller-note-input {
        display: none !important;
    }

    body.pdf-mode.pdf-legacy #order-page,
    body.pdf-mode.pdf-legacy #terms-page,
    body.pdf-mode.pdf-modular #dynamic-page {
        display: block !important;
        min-height: 0;
    }

    body.pdf-mode.pdf-legacy #dynamic-page,
    body.pdf-mode.pdf-modular #order-page,
    body.pdf-mode.pdf-modular #terms-page {
        display: none !important;
    }

    body.pdf-mode .order-page,
    body.pdf-mode .dynamic-contract-page {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        background: #fff;
    }

    body.pdf-mode .terms-page {
        padding: 0;
        background: #fff;
    }

    body.pdf-mode .document,
    body.pdf-mode .dynamic-contract-document {
        padding-top: 0;
    }

    body.pdf-mode .terms-content {
        padding: 0;
    }

    body.pdf-mode .po-head,
    body.pdf-mode .dynamic-contract-head {
        margin-top: 0;
        break-after: avoid;
        page-break-after: avoid;
    }

    body.pdf-mode .paper-card,
    body.pdf-mode .party-card,
    body.pdf-mode .term-section,
    body.pdf-mode .dynamic-contract-clauses article,
    body.pdf-mode .membership-whatsapp-reason {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.pdf-mode .dynamic-contract-items .table-wrap {
        overflow: visible;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods {
        min-width: 0;
        table-layout: fixed;
        font-size: 9px;
        line-height: 14px;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods th,
    body.pdf-mode .dynamic-contract-items .dynamic-goods td {
        padding: 6px 4px;
        overflow-wrap: anywhere;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(1),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(1) {
        width: 5%;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(2),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(2) {
        width: 12%;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(3),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(3) {
        width: 25%;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(4),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(4),
    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(5),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(5),
    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(6),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(6) {
        width: 8%;
    }

    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(7),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(7),
    body.pdf-mode .dynamic-contract-items .dynamic-goods th:nth-child(8),
    body.pdf-mode .dynamic-contract-items .dynamic-goods td:nth-child(8) {
        width: 13%;
    }

    body.pdf-mode .dynamic-contract-page.membership-template-page {
        width: auto;
        padding: 0;
    }

    body.pdf-mode .membership-template-page .dynamic-contract-head > span,
    body.pdf-mode .membership-template-page .dynamic-contract-head .dynamic-contract-meta {
        display: block;
    }

    body.pdf-mode .membership-template-page .dynamic-contract-head .dynamic-contract-meta {
        margin-top: 12px;
    }

    body.pdf-mode .membership-template-page .dynamic-contract-head {
        margin-bottom: 18px;
    }

    body.pdf-mode .membership-registration-form {
        margin-bottom: 18px;
    }

    body.pdf-mode .pdf-contract-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: fit-content;
        margin-top: 16px;
        padding: 10px 18px;
        border-radius: 8px;
        background: #2563eb;
        color: #fff !important;
        font-size: 13px;
        font-weight: 700;
        line-height: 18px;
        text-decoration: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.pdf-mode .membership-pdf-fields {
        gap: 10px;
    }
}

@media print and (max-width: 760px) {
    body.pdf-mode .membership-pdf-fields {
        grid-template-columns: 1fr;
    }
}
