.gk-generator {
    --gk-border: #dfe5ee;
    --gk-ink: #101828;
    --gk-muted: #667085;
    --gk-soft: #f6f8fb;
    --gk-panel: #ffffff;
    --gk-accent: #0f766e;
    --gk-product-color: #ffffff;
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(360px, 450px);
    grid-template-rows: auto 1fr;
    gap: 10px;
    align-items: start;
    color: var(--gk-ink);
    font-family: Arial, sans-serif;
    width: min(100%, 1360px);
    max-width: 100%;
    margin: 6px auto;
    min-height: min(720px, calc(100vh - 12px));
}

.gk-generator * {
    box-sizing: border-box;
    min-width: 0;
}

.gk-start {
    grid-column: 2;
    grid-row: 1;
    border: 1px solid var(--gk-border);
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
    transition: padding 160ms ease;
}

.gk-kicker {
    margin: 0 0 4px;
    color: var(--gk-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gk-start h2,
.gk-panel-head h3 {
    margin: 0;
    line-height: 1.15;
}

.gk-start h2 {
    display: none;
}

.gk-product-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 4px;
}

.gk-start.is-collapsed {
    padding: 10px;
}

.gk-start.is-collapsed h2 {
    display: none;
}

.gk-start.is-collapsed .gk-product-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 4px;
}

.gk-product-picker [data-gk-product-choice="sticker"] {
    grid-column: auto;
}

.gk-start.is-collapsed .gk-product-picker button,
.gk-product-picker button {
    min-height: 42px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: center;
    padding: 6px 5px;
    overflow: hidden;
}

.gk-start.is-collapsed .gk-product-picker strong,
.gk-product-picker strong {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.12;
    overflow-wrap: anywhere;
    hyphens: auto;
    word-break: normal;
}

.gk-start.is-collapsed .gk-product-picker small,
.gk-product-picker small,
.gk-product-icon {
    display: none;
}

.gk-product-picker button:hover,
.gk-product-picker button.is-active {
    border-color: var(--gk-accent);
    box-shadow: 0 14px 32px rgba(15, 118, 110, 0.12);
    transform: translateY(-1px);
}

.gk-product-picker button {
    border: 1px solid var(--gk-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--gk-ink);
    cursor: pointer;
    text-align: center;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    width: 100%;
}

.gk-product-picker strong {
    display: block;
}

.gk-generator__preview,
.gk-panel {
    border: 1px solid var(--gk-border);
    border-radius: 8px;
    background: var(--gk-panel);
}

.gk-generator__preview {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-height: min(700px, calc(100vh - 16px));
    display: grid;
    place-items: center;
    padding: 8px;
    background: #f7f9fc;
}

.gk-stage {
    position: relative;
    width: min(100%, 660px);
    aspect-ratio: 520 / 420;
    border-radius: 8px;
    overflow: hidden;
}

.gk-product-art {
    width: 100%;
    height: 100%;
    display: none;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.gk-shirt-back-mark {
    display: none;
}

.gk-generator[data-gk-product="sticker"] .gk-stage {
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, #eef2f6 25%, transparent 25%),
        linear-gradient(-45deg, #eef2f6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef2f6 75%),
        linear-gradient(-45deg, transparent 75%, #eef2f6 75%);
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    background-size: 24px 24px;
    border: 1px solid var(--gk-border);
}

.gk-generator[data-gk-product="sticker"] .gk-art-sticker,
.gk-generator[data-gk-product="shirt"][data-gk-side="front"] .gk-art-shirt-front,
.gk-generator[data-gk-product="shirt"][data-gk-side="back"] .gk-art-shirt-back,
.gk-generator[data-gk-product="hoodie"] .gk-art-hoodie,
.gk-generator[data-gk-product="body"] .gk-art-body,
.gk-generator[data-gk-product="bag"] .gk-art-bag,
.gk-generator[data-gk-product="mug"] .gk-art-mug {
    display: block;
}

.gk-generator[data-gk-product="shirt"] .gk-stage,
.gk-generator[data-gk-product="hoodie"] .gk-stage,
.gk-generator[data-gk-product="body"] .gk-stage,
.gk-generator[data-gk-product="bag"] .gk-stage {
    width: min(100%, 520px);
    aspect-ratio: 1 / 1;
    filter: drop-shadow(0 18px 26px rgba(15, 23, 42, 0.13));
}

.gk-generator[data-gk-product="mug"] .gk-stage {
    filter: drop-shadow(0 18px 26px rgba(15, 23, 42, 0.13));
}

.gk-generator[data-gk-product="shirt"] .gk-design-area,
.gk-generator[data-gk-product="hoodie"] .gk-design-area,
.gk-generator[data-gk-product="body"] .gk-design-area,
.gk-generator[data-gk-product="bag"] .gk-design-area,
.gk-generator[data-gk-product="mug"] .gk-design-area {
    mix-blend-mode: multiply;
}

.gk-design-area {
    position: absolute;
    outline: 1px dashed rgba(16, 24, 40, 0.24);
    outline-offset: 7px;
    overflow: visible;
    z-index: 3;
}

.gk-generator[data-gk-product="sticker"] .gk-design-area {
    left: 6%;
    top: 8%;
    width: 88%;
    height: 84%;
    outline-color: rgba(15, 118, 110, 0.42);
}

.gk-generator[data-gk-product="shirt"] .gk-design-area {
    left: 34%;
    top: 30%;
    width: 32%;
    height: 34%;
}

.gk-generator[data-gk-product="hoodie"] .gk-design-area {
    left: 35%;
    top: 31%;
    width: 30%;
    height: 28%;
}

.gk-generator[data-gk-product="body"] .gk-design-area {
    left: 35%;
    top: 25%;
    width: 30%;
    height: 40%;
}

.gk-generator[data-gk-product="bag"] .gk-design-area {
    left: 32%;
    top: 43%;
    width: 36%;
    height: 34%;
}

.gk-generator[data-gk-product="mug"] .gk-design-area {
    left: 25%;
    top: 25%;
    width: 35%;
    height: 51%;
}

.gk-panel {
    grid-column: 2;
    grid-row: 2;
    padding: 10px;
    display: grid;
    gap: 6px;
    overflow: auto;
    max-height: calc(100vh - 112px);
    align-content: start;
}

.gk-panel-head {
    display: grid;
    gap: 1px;
}

.gk-panel-head h3 {
    font-size: 16px;
    overflow-wrap: anywhere;
}

.gk-field {
    display: grid;
    gap: 3px;
    max-width: 100%;
}

.gk-field label,
.gk-field > span,
.gk-control {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.gk-field select,
.gk-field textarea,
.gk-field input[type="color"],
.gk-field input[type="text"],
.gk-field input[type="number"] {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--gk-border);
    border-radius: 6px;
    min-height: 32px;
    padding: 5px 7px;
    font: inherit;
    background: #ffffff;
}

.gk-font-select,
.gk-font-select option {
    font-size: 14px;
}

.gk-field textarea {
    resize: vertical;
    min-height: 36px;
}

.gk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    min-width: 0;
}

.gk-product-options [data-gk-option],
.gk-field[data-gk-option] {
    display: none;
}

.gk-generator[data-gk-product="sticker"] [data-gk-option="sticker"],
.gk-generator[data-gk-product="shirt"] [data-gk-option="shirt"],
.gk-generator[data-gk-product="mug"] [data-gk-option="mug"],
.gk-generator[data-gk-product="hoodie"] [data-gk-option="shirt"],
.gk-generator[data-gk-product="body"] [data-gk-option="shirt"] {
    display: grid;
}

.gk-generator[data-gk-product="hoodie"] > .gk-panel > .gk-field[data-gk-option="shirt"],
.gk-generator[data-gk-product="body"] > .gk-panel > .gk-field[data-gk-option="shirt"] {
    display: none;
}

.gk-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.gk-swatches button,
.gk-size-buttons button {
    width: 28px;
    height: 28px;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--gk-border);
    border-radius: 999px;
    cursor: pointer;
}

.gk-swatches button {
    background: var(--gk-color);
    flex: 0 0 28px;
    min-width: 28px;
    padding: 0;
}

.gk-size-buttons {
    display: grid;
    grid-template-columns: repeat(6, minmax(34px, 1fr));
    gap: 5px;
    align-items: center;
}

.gk-size-buttons button {
    width: 100%;
    height: 32px;
    background: #ffffff;
    color: var(--gk-ink);
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
    line-height: 1;
    border-radius: 999px;
}

.gk-swatches button.is-active {
    outline: 3px solid var(--gk-accent);
    outline-offset: 2px;
}

.gk-size-buttons button.is-active {
    border-color: var(--gk-accent);
    background: var(--gk-accent);
    color: #ffffff;
}

.gk-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.gk-segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--gk-border);
    border-radius: 8px;
    background: var(--gk-soft);
}

.gk-segmented button {
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--gk-muted);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.gk-segmented button.is-active {
    background: #ffffff;
    color: var(--gk-ink);
    box-shadow: 0 1px 5px rgba(16, 24, 40, 0.12);
}

.gk-actions--wrap {
    flex-wrap: wrap;
}

.gk-shape-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(28px, 1fr));
    gap: 4px;
    max-width: 100%;
}

.gk-shape-grid button {
    border: 1px solid var(--gk-border);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    min-height: 28px;
    padding: 3px;
    display: grid;
    place-items: center;
}

.gk-shape-grid button:hover {
    border-color: var(--gk-accent);
    background: #f0fdfa;
}

.gk-shape-grid svg {
    width: 18px;
    height: 18px;
    fill: #101828;
}

.gk-button {
    appearance: none;
    border: 1px solid #101828;
    border-radius: 6px;
    background: #101828;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 8px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: normal;
    line-height: 1.12;
}

.gk-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.gk-button--ghost {
    background: #ffffff;
    color: #101828;
}

.gk-control {
    display: grid;
    gap: 4px;
    color: var(--gk-muted);
}

.gk-control input {
    width: 100%;
}

.gk-control--inline {
    flex: 1 1 120px;
    min-height: 34px;
    align-content: center;
}

.gk-item {
    position: absolute;
    left: 50%;
    top: 50%;
    min-width: 40px;
    min-height: 32px;
    display: grid;
    place-items: center;
    cursor: move;
    user-select: none;
    transform-origin: center;
    touch-action: none;
    width: auto;
}

.gk-item[hidden] {
    display: none !important;
}

.gk-item.is-selected {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
}

.gk-item-remove {
    position: absolute;
    right: -13px;
    top: -13px;
    width: 24px;
    height: 24px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #101828;
    color: #ffffff;
    cursor: pointer;
    display: none;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    z-index: 2;
    padding: 0;
}

.gk-item.is-selected .gk-item-remove {
    display: grid;
    place-items: center;
}

.gk-item-resize {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #2563eb;
    cursor: nwse-resize;
    display: none;
    z-index: 2;
}

.gk-item.is-selected .gk-item-resize {
    display: block;
}

.gk-item img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.gk-item svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    overflow: visible;
}

.gk-text-item {
    white-space: pre-wrap;
    text-align: center;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    overflow-wrap: anywhere;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.gk-draw-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    cursor: crosshair;
    touch-action: none;
}

.gk-generator.is-drawing .gk-draw-layer {
    display: block;
}

.gk-generator.is-drawing [data-gk-draw] {
    background: var(--gk-accent);
    border-color: var(--gk-accent);
    color: #ffffff;
}

.gk-cart-thumb {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border: 1px solid #dfe5ee;
    border-radius: 6px;
    background: #ffffff;
}

.gk-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--gk-border);
    border-radius: 8px;
    padding: 6px 8px;
    background: #ffffff;
}

.gk-price span {
    color: var(--gk-muted);
    font-size: 13px;
    font-weight: 700;
}

.gk-price strong {
    font-size: 18px;
}

.gk-summary {
    margin: 0;
    padding: 6px 8px;
    border-radius: 6px;
    background: var(--gk-soft);
    color: var(--gk-muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.gk-cart-note:empty {
    display: none;
}

.gk-cart-note.is-error {
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 980px) {
    .gk-generator {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .gk-start,
    .gk-generator__preview,
    .gk-panel {
        grid-column: auto;
        grid-row: auto;
    }

    .gk-generator__preview {
        min-height: auto;
    }

    .gk-panel {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .gk-grid {
        grid-template-columns: 1fr;
    }

    .gk-start.is-collapsed .gk-product-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gk-size-buttons {
        grid-template-columns: repeat(6, minmax(34px, 1fr));
    }

    .gk-actions {
        flex-direction: column;
    }

    .gk-shape-grid {
        grid-template-columns: repeat(4, minmax(32px, 1fr));
    }
}
