.gp-calc {
    --gp-bg: #f5f7fb;
    --gp-card: #ffffff;
    --gp-border: #d6e0ea;
    --gp-text: #1f2d3d;
    --gp-muted: #556576;
    --gp-accent: #045c91;
    --gp-accent-strong: #004872;
    --gp-success: #1f9d55;
    --gp-error: #c33d2f;

    font-family: Manrope, 'Segoe UI', sans-serif;
    color: var(--gp-text);
}

.gp-calc__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.85fr);
    gap: 24px;
    align-items: start;
}

.gp-card {
    background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--gp-border);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(0, 36, 72, 0.08);
    padding: 24px;
}

.gp-card--form {
    background:
        radial-gradient(circle at right top, rgba(4, 92, 145, 0.14), transparent 35%),
        linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
}

.gp-title {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.25;
}

.gp-subtitle {
    margin: 10px 0 18px;
    color: var(--gp-muted);
}

.gp-field {
    display: block;
    margin-bottom: 14px;
}

.gp-field__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.gp-segment-picker {
    margin-top: 12px;
    margin-bottom: 16px;
}

.gp-fill-mode-picker {
    margin-top: 16px;
    margin-bottom: 18px;
}

.gp-fill-mode-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.gp-card--result {
    position: relative;
    overflow: hidden;
}

.gp-card--result::after {
    content: '';
    display: none;
}

.gp-card--result.is-locked::after {
    content: attr(data-lock-message);
    position: absolute;
    left: 16px;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    border: 1px solid rgba(4, 92, 145, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(5px);
    color: #1f2d3d;
    font-weight: 700;
    text-align: center;
    padding: 12px 14px;
    z-index: 8;
}

.gp-card--result.is-locked .gp-summary,
.gp-card--result.is-locked .gp-lines,
.gp-card--result.is-locked .gp-add-bundle,
.gp-card--result.is-locked .gp-cart-link {
    filter: blur(2px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.gp-fill-mode-card {
    border: 1px solid var(--gp-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.gp-fill-mode-card:hover {
    transform: translateY(-1px);
    border-color: var(--gp-accent);
}

.gp-fill-mode-card.is-active {
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px rgba(4, 92, 145, 0.14);
}

.gp-fill-mode-card__head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.gp-fill-mode-card__head strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.gp-fill-mode-card__head small {
    color: var(--gp-muted);
    font-size: 0.79rem;
    font-weight: 700;
}

.gp-fill-mode-card__image {
    display: block;
    border: 1px solid #d1dce7;
    border-radius: 8px;
    background: linear-gradient(180deg, #fdfefe, #eef4fb);
    padding: 6px;
    aspect-ratio: 16 / 6;
}

.gp-fill-mode-card__image-inner {
    width: 100%;
    height: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
}

.gp-segment-legend {
    margin: -6px 0 12px;
    color: var(--gp-muted);
    font-size: 0.86rem;
}

.gp-segment-options {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.gp-segment-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gp-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.gp-segment-card:hover {
    transform: translateY(-1px);
    border-color: var(--gp-accent);
}

.gp-segment-card.is-active {
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px rgba(4, 92, 145, 0.14);
}

.gp-segment-card__head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.gp-segment-card__head strong {
    font-size: 0.95rem;
    line-height: 1.25;
}

.gp-segment-card__head small {
    color: var(--gp-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.gp-segment-card__mini {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    padding: 4px 8px;
    border: 1px solid #d1dce7;
    border-radius: 8px;
    background: linear-gradient(180deg, #fdfefe, #eef4fb);
    margin-bottom: 0;
    overflow: hidden;
}

.gp-segment-card__mini-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center bottom;
    transform-origin: center bottom;
    transition: transform 0.2s ease;
}

.gp-segment-mini__post {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, #768594, #596675);
    z-index: 2;
}

.gp-segment-mini__post--left {
    left: 8px;
}

.gp-segment-mini__post--right {
    right: 8px;
}

.gp-segment-mini__mesh {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 16px;
    right: 16px;
    z-index: 1;
}

.gp-segment-mini__mesh::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(79, 96, 113, 0.34) 0,
        rgba(79, 96, 113, 0.34) 1px,
        rgba(79, 96, 113, 0) 1px,
        rgba(79, 96, 113, 0) 11px
    );
    opacity: 1;
}

.gp-segment-mini__row {
    position: absolute;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    border-radius: 4px;
    background: rgba(66, 86, 104, 0.72);
    box-shadow: none;
}

.gp-segment-mini__row.is-wide {
    height: 4px;
}

.gp-segment-mini__row.is-narrow {
    height: 2px;
    opacity: 0.9;
}

.gp-field--qty {
    margin-bottom: 16px;
}

.gp-qty-control {
    display: inline-flex !important;
    align-items: center !important;
    border: 2px solid #c0d0e1 !important;
    border-radius: 22px !important;
    background: #fff !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(20, 53, 87, 0.06) !important;
}

.gp-qty-btn {
    width: 48px !important;
    height: 48px !important;
    border: 0 !important;
    background: #eaf2fb !important;
    color: #1f2d3d !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gp-qty-btn:hover {
    background: #d7e8fa !important;
}

.gp-qty-btn:focus-visible {
    outline: 2px solid #086fb3 !important;
    outline-offset: -2px !important;
}

.gp-segment-count {
    width: 92px !important;
    min-width: 92px !important;
    border: 0 !important;
    border-left: 1px solid #d6e2ef !important;
    border-right: 1px solid #d6e2ef !important;
    text-align: center !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: #1f2d3d !important;
    background: #ffffff !important;
    padding: 6px 4px !important;
    height: 48px !important;
    line-height: 1 !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    margin: 0 !important;
}

.gp-segment-count::-webkit-outer-spin-button,
.gp-segment-count::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gp-segment-count:focus {
    outline: none !important;
}

.gp-mode {
    border: 1px solid var(--gp-border) !important;
    border-radius: 16px !important;
    padding: 12px !important;
    margin: 18px 0;
    background: #fbfdff !important;
}

.gp-mode__item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
    cursor: pointer !important;
    border: 1px solid #d4e1ee !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
    background: #ffffff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.gp-mode__item span {
    line-height: 1.35 !important;
}

.gp-mode__item:last-child {
    margin-bottom: 0 !important;
}

.gp-mode__item input[type='radio'] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border-radius: 50% !important;
    border: 2px solid #8fa6bc !important;
    background: #fff !important;
    position: relative !important;
    flex: 0 0 20px !important;
}

.gp-mode__item input[type='radio']::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #0a7fd1;
    transform: scale(0);
    transition: transform 0.15s ease;
}

.gp-mode__item input[type='radio']:checked {
    border-color: #0a7fd1 !important;
}

.gp-mode__item input[type='radio']:checked::after {
    transform: scale(1);
}

.gp-mode__item input[type='radio']:checked + span {
    font-weight: 700;
    color: #16314a;
}

.gp-color-palette {
    margin-top: 16px;
}

.gp-color-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gp-color-btn {
    --gp-color: #6e7c8c;

    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--gp-border);
    border-radius: 12px;
    padding: 10px 10px;
    background: #fff;
    color: var(--gp-text);
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gp-color-btn:hover {
    transform: translateY(-1px);
    border-color: var(--gp-accent);
}

.gp-color-btn.is-active {
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 3px rgba(4, 92, 145, 0.14);
}

.gp-color-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gp-color-btn__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gp-color);
    border: 1px solid rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
    flex: 0 0 18px;
}

.gp-color-btn__text {
    font-size: 0.9rem;
    line-height: 1.2;
}

.gp-note {
    margin: 16px 0 0;
    color: var(--gp-muted);
    font-size: 0.92rem;
}

.gp-preview {
    display: none;
    border-radius: 16px;
    height: 360px;
    background:
        radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.92), rgba(240, 247, 255, 0.88)),
        linear-gradient(180deg, #f7fbff, #edf2f8);
    border: 1px solid var(--gp-border);
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    transition: height 0.24s ease;
}

.gp-preview__segment-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: fill;
    object-position: center bottom;
    transform: none;
    z-index: 2;
    display: none;
    pointer-events: none;
}

.gp-preview::before,
.gp-preview::after {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    height: 9px;
    z-index: 2;
    pointer-events: none;
}

.gp-preview::before {
    top: 12px;
    background: repeating-linear-gradient(
        135deg,
        rgba(63, 84, 104, 0.72) 0,
        rgba(63, 84, 104, 0.72) 2px,
        transparent 2px,
        transparent 10px
    );
}

.gp-preview::after {
    bottom: 12px;
    background: repeating-linear-gradient(
        -135deg,
        rgba(63, 84, 104, 0.72) 0,
        rgba(63, 84, 104, 0.72) 2px,
        transparent 2px,
        transparent 10px
    );
}

.gp-preview__mesh {
    position: absolute;
    inset: 18px 22px;
    border-radius: 12px;
    border-left: 2px solid rgba(63, 84, 104, 0.55);
    border-right: 2px solid rgba(63, 84, 104, 0.55);
    background:
        repeating-linear-gradient(
            90deg,
            rgba(58, 80, 102, 0.26) 0,
            rgba(58, 80, 102, 0.26) 1px,
            transparent 1px,
            transparent 24px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(58, 80, 102, 0.18) 0,
            rgba(58, 80, 102, 0.18) 1px,
            transparent 1px,
            transparent 30px
        );
    z-index: 2;
}

.gp-preview__posts,
.gp-preview__strips {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gp-preview__posts {
    z-index: 4;
}

.gp-preview__strips {
    z-index: 5;
}

.gp-preview.has-svg::before,
.gp-preview.has-svg::after {
    display: none;
}

.gp-preview.has-svg .gp-preview__mesh {
    opacity: 0;
}

.gp-preview.has-svg .gp-preview__posts {
    opacity: 0;
}

.gp-preview.has-svg .gp-preview__strip {
    left: 3%;
    right: 3%;
}

.gp-preview__post {
    position: absolute;
    top: 18px;
    bottom: 18px;
    transform: translateX(-50%);
    width: 10px;
    background: linear-gradient(180deg, #718394, #4f6174);
    border-radius: 5px;
    opacity: 0.92;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.gp-preview__strip {
    position: absolute;
    left: 22px;
    right: 22px;
    border-radius: 999px;
    box-shadow: none;
    transform: translateY(-50%);
    filter: saturate(0.92);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.08)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.04));
}

.gp-preview__strip--wide {
    height: 12px;
    opacity: 0.94;
}

.gp-preview__strip--narrow {
    height: 4px;
    opacity: 0.9;
}

.gp-summary {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--gp-border);
    border-radius: 12px;
    overflow: hidden;
}

.gp-summary li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gp-border);
    font-size: 0.95rem;
}

.gp-summary li:last-child {
    border-bottom: 0;
}

.gp-summary li span {
    color: var(--gp-muted);
}

.gp-lines {
    margin-top: 14px;
    border-top: 1px dashed var(--gp-border);
    padding-top: 12px;
}

.gp-line-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.gp-line-item--total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gp-border);
    font-size: 1.1rem;
}

.gp-add-bundle {
    margin-top: 12px;
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 13px 16px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--gp-accent), var(--gp-accent-strong));
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease, opacity 0.2s ease;
}

.gp-add-bundle:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.gp-add-bundle:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.gp-cart-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--gp-accent);
    text-decoration: none;
    font-weight: 600;
}

.gp-cart-link:hover {
    text-decoration: underline;
}

.gp-status {
    min-height: 22px;
    margin: 12px 0 0;
    line-height: 1.35;
    color: var(--gp-muted);
}

.gp-status.is-success {
    color: var(--gp-success);
}

.gp-status.is-error {
    color: var(--gp-error);
}

.gp-calc--notice {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #f1c3c3;
    background: #fff2f2;
    color: #7f1d1d;
}

@media (max-width: 980px) {
    .gp-calc__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1280px) {
    .gp-fill-mode-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gp-segment-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .gp-calc__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1200px) {
    .gp-segment-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .gp-fill-mode-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gp-segment-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gp-color-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 580px) {
    .gp-fill-mode-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gp-card {
        padding: 16px;
        border-radius: 14px;
    }

    .gp-title {
        font-size: 1.35rem;
    }

    .gp-preview {
        height: 300px;
    }
}

.content ol,
.content ul {
    margin: 0 0 10px 0px;
}
