.csg-fig {
    width: min(1180px, 100%);
    margin: 2px auto;
    padding: 14px;
    background: #FFEAD5;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .11);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
}

.csg-fig * {
    box-sizing: border-box;
}

.csg-fig__topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.csg-fig__eyebrow {
    font-size: 11px;
    letter-spacing: .15em;
    font-weight: 800;
    color: #6366f1;
}

.csg-fig h2 {
    margin: 4px 0 5px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.1;
}

.csg-fig__topbar p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.csg-fig__badge {
    white-space: nowrap;
    padding: 8px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.csg-fig__layout {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 28px;
}

.csg-fig__section {
    padding: 0 0 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eef2f7;
}

.csg-fig__section-title {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #64748b;
}

.csg-fig__label {
    display: block;
    margin: 0 0 7px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.csg-fig__textarea,
.csg-fig__font,
.csg-fig__weight,
.csg-fig__position {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    outline: none;
}

.csg-fig__textarea {
    min-height: 150px;
    resize: vertical;
    padding: 12px;
    font: 15px/1.6 inherit;
}

.csg-fig__font,
.csg-fig__weight,
.csg-fig__position {
    height: 42px;
    padding: 8px 10px;
}

.csg-fig__textarea:focus,
.csg-fig__font:focus,
.csg-fig__weight:focus,
.csg-fig__position:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .11);
}

.csg-fig__upload {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.csg-fig__upload-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px dashed #a5b4fc;
    border-radius: 12px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.csg-fig__upload-button input {
    display: none;
}

.csg-fig__remove-image {
    border: 0;
    background: #f1f5f9;
    color: #475569;
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
    cursor: pointer;
}

.csg-fig__filename {
    margin-top: 6px;
    font-size: 11px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csg-fig__templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.csg-fig__templates button,
.csg-fig__segmented button {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    border-radius: 9px;
    padding: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.csg-fig__templates button.is-active,
.csg-fig__segmented button.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.csg-fig__two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.csg-fig__segmented {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.csg-fig input[type=range] {
    width: 100%;
    accent-color: #4f46e5;
}

.csg-fig__size-output {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
}

.csg-fig__color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.csg-fig__color-grid label {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.csg-fig__color-grid span {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    color: #64748b;
}

.csg-fig__color-grid input {
    width: 100%;
    height: 28px;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
}

.csg-fig__range-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
    margin-top: -3px;
    margin-bottom: 12px;
}

.csg-fig__download {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 14px;
    background: #4f46e5;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .2);
}

.csg-fig__reset {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    color: #475569;
    font-weight: 700;
    cursor: pointer;
}

.csg-fig__preview {
    overflow: hidden;
    border-radius: 18px;
    background: #e2e8f0;
    box-shadow: 0 20px 55px rgba(15, 23, 42, .18);
}

.csg-fig__canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 630;
    background-color: #FCC997;
}

.csg-fig__stage-info {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    color: #FCC997;
    font-size: 11px;
}

@media (max-width: 850px) {
    .csg-fig__layout {
        grid-template-columns: 1fr;
    }

    .csg-fig__stage {
        order: -1;
    }
}

@media (max-width: 520px) {
    .csg-fig {
        padding: 15px;
        border-radius: 18px;
    }

    .csg-fig__topbar {
        display: block;
    }

    .csg-fig__badge {
        display: inline-block;
        margin-top: 12px;
    }

    .csg-fig__two,
    .csg-fig__color-grid {
        grid-template-columns: 1fr;
    }

    .csg-fig__upload {
        display: block;
    }

    .csg-fig__remove-image {
        width: 100%;
        margin-top: 7px;
    }
}