.hub3pb-generator,
.hub3pb-generator * {
    box-sizing: border-box;
}

.hub3pb-generator {
    width: 100%;
    max-width: var(--hub3pb-max, none);
    margin: 0 auto;
    font-family: var(--hub3pb-font, inherit);
    font-size: var(--hub3pb-base, 16px);
    line-height: 1.5;
    color: var(--hub3pb-text, #171725);
}

.hub3pb-form,
.hub3pb-result {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: var(--hub3pb-bg, #ffffff);
    border: 1px solid color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 86%, var(--hub3pb-accent, #6456e5) 14%);
    border-radius: var(--hub3pb-radius, 24px);
    padding: var(--hub3pb-pad, 32px);
    box-shadow: 0 18px 60px rgba(30, 26, 62, .08), 0 2px 8px rgba(30, 26, 62, .035);
}

.hub3pb-form::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: -190px;
    right: -150px;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 92%, transparent) 0%, transparent 70%);
    pointer-events: none;
}

.hub3pb-form > *,
.hub3pb-result > * {
    position: relative;
    z-index: 1;
}

.hub3pb-head {
    max-width: 800px;
    margin-bottom: var(--hub3pb-section-gap, 30px);
}

.hub3pb-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    color: var(--hub3pb-accent, #6456e5);
    font-size: 12px;
    line-height: 1;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.hub3pb-kicker span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hub3pb-accent, #6456e5), var(--hub3pb-accent-2, #5b4fd2));
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 72%, transparent);
}

.hub3pb-head h2,
.hub3pb-result h3,
.hub3pb-section h3 {
    color: var(--hub3pb-text, #171725);
    font-family: inherit;
    text-transform: none;
    letter-spacing: -.025em;
}

.hub3pb-head h2 {
    margin: 0 0 10px;
    font-size: var(--hub3pb-heading, 34px);
    line-height: 1.08;
    font-weight: 760;
}

.hub3pb-head p,
.hub3pb-result-head p,
.hub3pb-help {
    margin: 0;
    color: var(--hub3pb-label-color, #667080);
}

.hub3pb-head p {
    max-width: 720px;
    font-size: calc(var(--hub3pb-base, 16px) * .96);
}

.hub3pb-section {
    padding-top: var(--hub3pb-section-gap, 30px);
    border-top: 1px solid color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 82%, transparent);
}

.hub3pb-section + .hub3pb-section {
    margin-top: var(--hub3pb-section-gap, 28px);
}

.hub3pb-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
}

.hub3pb-section-index {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid color-mix(in srgb, var(--hub3pb-accent, #6456e5) 18%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 78%, #ffffff 22%);
    color: var(--hub3pb-accent, #6456e5);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .05em;
}

.hub3pb-section h3 {
    margin: 0;
    font-size: calc(var(--hub3pb-base, 16px) + 3px);
    line-height: 1.25;
    font-weight: 720;
}

.hub3pb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--hub3pb-field-gap, 18px);
    align-items: start;
}

.hub3pb-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    margin: 0;
}

.hub3pb-span-2 {
    grid-column: 1 / -1;
}

.hub3pb-label {
    display: block;
    color: var(--hub3pb-label-color, #667080);
    font-size: var(--hub3pb-label, 14px);
    line-height: 1.35;
    font-weight: 620;
}

.hub3pb-label b {
    margin-left: 3px;
    color: var(--hub3pb-accent, #6456e5);
}

.hub3pb-field input {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--hub3pb-input-border, #e3e5ea);
    border-radius: calc(var(--hub3pb-radius, 24px) * .5);
    outline: none;
    background: var(--hub3pb-input-bg, #ffffff);
    box-shadow: 0 1px 2px rgba(23, 23, 37, .025);
    color: var(--hub3pb-input-text, #171725);
    font: inherit;
    font-size: var(--hub3pb-base, 16px);
    line-height: 1.35;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
    appearance: none;
}

.hub3pb-field input:hover {
    border-color: color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 55%, var(--hub3pb-accent, #6456e5) 45%);
}

.hub3pb-field input::placeholder {
    color: color-mix(in srgb, var(--hub3pb-input-text, #171725) 40%, transparent);
    opacity: 1;
}

.hub3pb-field input:focus {
    border-color: var(--hub3pb-accent, #6456e5);
    background: #ffffff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 74%, transparent);
}

.hub3pb-field input.hub3pb-invalid {
    border-color: var(--hub3pb-error, #b42318);
}

.hub3pb-field input.hub3pb-invalid:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hub3pb-error, #b42318) 12%, transparent);
}

.hub3pb-field-error {
    display: block;
    min-height: 0;
    color: var(--hub3pb-error, #b42318);
    font-size: 12px;
    line-height: 1.35;
}

.hub3pb-field-error:empty {
    display: none;
}

.hub3pb-help {
    margin-top: 13px;
    font-size: 13px;
    line-height: 1.5;
}

.hub3pb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 11px;
    margin-top: var(--hub3pb-section-gap, 30px);
}

.hub3pb-actions button,
.hub3pb-download {
    min-height: 48px;
    margin: 0;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: calc(var(--hub3pb-radius, 24px) * .5);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.hub3pb-actions button:active,
.hub3pb-download:active {
    transform: translateY(1px);
}

.hub3pb-generate,
.hub3pb-download {
    border-color: var(--hub3pb-accent, #6456e5) !important;
    background: linear-gradient(135deg, var(--hub3pb-accent, #6456e5), var(--hub3pb-accent-2, #5b4fd2)) !important;
    box-shadow: 0 10px 26px color-mix(in srgb, var(--hub3pb-accent, #6456e5) 22%, transparent);
    color: var(--hub3pb-button-text, #ffffff) !important;
}

.hub3pb-generate:hover,
.hub3pb-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--hub3pb-accent, #6456e5) 28%, transparent);
}

.hub3pb-reset {
    border-color: var(--hub3pb-input-border, #e3e5ea) !important;
    background: rgba(255,255,255,.7) !important;
    color: var(--hub3pb-text, #171725) !important;
}

.hub3pb-reset:hover {
    border-color: color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 52%, var(--hub3pb-accent, #6456e5) 48%) !important;
    background: color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 34%, #ffffff 66%) !important;
}

.hub3pb-form-error {
    margin-top: 13px;
    color: var(--hub3pb-error, #b42318);
    font-size: 14px;
    font-weight: 650;
}

.hub3pb-form-error:empty {
    display: none;
}

.hub3pb-result {
    margin-top: 22px;
    background: linear-gradient(180deg, var(--hub3pb-result-bg, #f8f7ff), #ffffff 86%);
}

.hub3pb-result[hidden] {
    display: none !important;
}

.hub3pb-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.hub3pb-result-head h3 {
    margin: 0 0 5px;
    font-size: calc(var(--hub3pb-base, 16px) + 5px);
    line-height: 1.25;
    font-weight: 730;
}

.hub3pb-result-head p {
    max-width: 660px;
    font-size: 13px;
}

.hub3pb-download {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 15px;
    font-size: 13px;
}

.hub3pb-barcode-wrap {
    overflow: auto;
    width: 100%;
    padding: clamp(14px, 2vw, 24px);
    border: 1px solid color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 86%, transparent);
    border-radius: calc(var(--hub3pb-radius, 24px) * .64);
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
    text-align: center;
}

.hub3pb-canvas {
    display: block;
    width: min(100%, var(--hub3pb-barcode-max, 580px));
    height: auto;
    margin: 0 auto;
    background: #ffffff;
    image-rendering: pixelated;
}

.hub3pb-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.hub3pb-summary > div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 82%, transparent);
    border-radius: 12px;
    background: rgba(255,255,255,.72);
}

.hub3pb-summary span,
.hub3pb-summary strong {
    display: block;
}

.hub3pb-summary span {
    margin-bottom: 3px;
    color: var(--hub3pb-label-color, #667080);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 600;
}

.hub3pb-summary strong {
    overflow-wrap: anywhere;
    color: var(--hub3pb-text, #171725);
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 1080px) {
    .hub3pb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hub3pb-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .hub3pb-form,
    .hub3pb-result {
        border-radius: var(--hub3pb-radius, 24px);
        padding: max(16px, calc(var(--hub3pb-pad, 32px) * .72));
    }

    .hub3pb-form::before {
        top: -230px;
        right: -230px;
    }

    .hub3pb-grid,
    .hub3pb-summary {
        grid-template-columns: 1fr;
    }

    .hub3pb-span-2 {
        grid-column: auto;
    }

    .hub3pb-result-head {
        flex-direction: column;
    }

    .hub3pb-download {
        width: 100%;
    }

    .hub3pb-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hub3pb-actions button {
        width: 100%;
    }

    .hub3pb-barcode-wrap {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hub3pb-generator * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* v1.2.0 – simplified payment-first form */
.hub3pb-span-2 {
    grid-column: span 2;
}

.hub3pb-span-full {
    grid-column: 1 / -1;
}

.hub3pb-field input:disabled {
    cursor: not-allowed;
    border-color: color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 88%, transparent);
    background: color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 28%, #ffffff 72%);
    color: color-mix(in srgb, var(--hub3pb-input-text, #171725) 70%, #ffffff 30%);
    opacity: 1;
}

.hub3pb-optional-section {
    margin-top: var(--hub3pb-section-gap, 30px);
    border: 1px solid color-mix(in srgb, var(--hub3pb-input-border, #e3e5ea) 82%, transparent);
    border-radius: calc(var(--hub3pb-radius, 24px) * .66);
    background: color-mix(in srgb, var(--hub3pb-soft-accent, #eeebff) 18%, #ffffff 82%);
    overflow: hidden;
}

.hub3pb-optional-section summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.hub3pb-optional-section summary::-webkit-details-marker {
    display: none;
}

.hub3pb-optional-section summary > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hub3pb-optional-section summary strong {
    color: var(--hub3pb-text, #171725);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 720;
}

.hub3pb-optional-section summary small {
    color: var(--hub3pb-label-color, #667080);
    font-size: 12px;
    line-height: 1.4;
}

.hub3pb-optional-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--hub3pb-soft-accent, #eeebff);
    color: var(--hub3pb-accent, #6456e5);
    font-size: 20px;
    line-height: 1;
    font-weight: 500;
    transition: transform .18s ease, background-color .18s ease;
}

.hub3pb-optional-section[open] .hub3pb-optional-icon {
    transform: rotate(45deg);
}

.hub3pb-optional-content {
    padding: 0 18px 18px;
}

@media (max-width: 1080px) {
    .hub3pb-span-2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .hub3pb-span-2,
    .hub3pb-span-full {
        grid-column: auto;
    }

    .hub3pb-optional-section summary {
        align-items: flex-start;
        padding: 14px 15px;
    }

    .hub3pb-optional-content {
        padding: 0 15px 15px;
    }
}
