:root {
    --gfx-editor-primary: #6b4eff;
}

.gfx-editor-runtime,
.gfx-editor-runtime * {
    box-sizing: border-box;
}

.gfx-editor-runtime [hidden] {
    display: none !important;
}

.gfx-editor-toggle {
    position: fixed;
    z-index: 99998;
    right: 24px;
    bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 47px;
    padding: 0 18px;
    border: 1px solid rgba(107, 78, 255, .2);
    border-radius: 999px;
    color: #fff;
    background: var(--gfx-editor-primary);
    box-shadow: 0 14px 34px rgba(50, 35, 120, .28);
    font: 650 14px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.gfx-editor-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(50, 35, 120, .34);
}

.gfx-editor-toggle__icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: var(--gfx-editor-primary);
    background: #fff;
    font-size: 15px;
}

.gfx-editor-panel {
    position: fixed;
    z-index: 99999;
    top: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    width: min(510px, calc(100vw - 32px));
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(107, 78, 255, .16);
    border-radius: 22px;
    color: #171326;
    background: #fff;
    box-shadow: 0 30px 90px rgba(32, 22, 74, .3);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0;
    transform: translateX(20px) scale(.985);
    transition: opacity .18s ease, transform .18s ease;
}

.gfx-editor-panel.is-open {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.gfx-editor-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 21px 17px;
    border-bottom: 1px solid #ece8fb;
    background: linear-gradient(135deg, #f8f6ff, #fff);
}

.gfx-editor-header h2 {
    margin: 3px 0 0;
    color: #171326;
    font-size: 20px;
    line-height: 1.25;
}

.gfx-editor-eyebrow {
    display: block;
    color: #756d91;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.gfx-editor-icon-button {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid #e4dff1;
    border-radius: 10px;
    color: #5d5571;
    background: #fff;
    font: 400 23px/1 inherit;
    cursor: pointer;
}

.gfx-editor-icon-button:hover {
    border-color: #cfc6e8;
    color: #241c3e;
}

.gfx-editor-icon-button--danger {
    color: #ad2436;
    background: #fff6f7;
}

.gfx-editor-status {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-bottom: 1px solid #eeeaf6;
    color: #5e566f;
    background: #fcfbff;
    font-size: 12px;
}

.gfx-editor-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a56c;
    box-shadow: 0 0 0 4px rgba(40, 165, 108, .11);
}

.gfx-editor-status.is-error {
    color: #9f2434;
    background: #fff6f7;
}

.gfx-editor-status.is-error .gfx-editor-status__dot {
    background: #d23b4f;
    box-shadow: 0 0 0 4px rgba(210, 59, 79, .11);
}

.gfx-editor-status.is-busy .gfx-editor-status__dot {
    background: #e59a22;
    box-shadow: 0 0 0 4px rgba(229, 154, 34, .12);
}

.gfx-editor-tabs {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid #e9e5f2;
}

.gfx-editor-tabs button {
    padding: 12px 6px 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #756d85;
    background: #fff;
    font: 650 12px/1 inherit;
    cursor: pointer;
}

.gfx-editor-tabs button.is-active {
    border-bottom-color: var(--gfx-editor-primary);
    color: var(--gfx-editor-primary);
    background: #faf9ff;
}

.gfx-editor-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
}

.gfx-editor-view {
    display: none;
}

.gfx-editor-view.is-active {
    display: block;
}

.gfx-editor-intro {
    margin-bottom: 16px;
}

.gfx-editor-intro h3 {
    margin: 0 0 5px;
    color: #211a34;
    font-size: 17px;
}

.gfx-editor-intro p,
.gfx-editor-help,
.gfx-editor-empty {
    margin: 0;
    color: #6c647a;
    font-size: 13px;
    line-height: 1.55;
}

.gfx-editor-help {
    margin-top: 14px;
    padding: 11px 12px;
    border-radius: 10px;
    background: #f7f5fb;
}

.gfx-editor-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid #dcd6e9;
    border-radius: 10px;
    color: #423956;
    background: #fff;
    font: 650 12px/1 inherit;
    cursor: pointer;
}

.gfx-editor-button:hover {
    border-color: #bfb4dc;
}

.gfx-editor-button:disabled {
    cursor: wait;
    opacity: .6;
}

.gfx-editor-button--primary {
    border-color: var(--gfx-editor-primary);
    color: #fff;
    background: var(--gfx-editor-primary);
}

.gfx-editor-button.is-active {
    border-color: #e59a22;
    color: #7f4a00;
    background: #fff7e8;
}

.gfx-editor-selected {
    margin-top: 17px;
    padding: 16px;
    border: 1px solid #ded8ed;
    border-radius: 14px;
    background: #faf9fd;
}

.gfx-editor-selected label,
.gfx-editor-field-grid label {
    display: grid;
    gap: 6px;
    color: #514960;
    font-size: 11px;
    font-weight: 700;
}

.gfx-editor-original {
    margin: 7px 0 14px;
    padding: 10px 11px;
    border-left: 3px solid #c5badf;
    color: #5c546c;
    background: #fff;
    font-size: 12px;
    line-height: 1.55;
}

.gfx-editor-selected textarea,
.gfx-editor-field-grid input,
.gfx-editor-field-grid textarea,
.gfx-editor-field-grid select {
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid #d9d3e6;
    border-radius: 9px;
    color: #241d33;
    background: #fff;
    font: 400 13px/1.4 inherit;
}

.gfx-editor-selected textarea:focus,
.gfx-editor-field-grid input:focus,
.gfx-editor-field-grid textarea:focus,
.gfx-editor-field-grid select:focus {
    border-color: var(--gfx-editor-primary);
    outline: 3px solid rgba(107, 78, 255, .11);
}

.gfx-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 13px;
}

.gfx-editor-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 15px;
}

.gfx-editor-field-grid input[type="color"] {
    height: 42px;
    padding: 3px;
}

.gfx-editor-field-grid input[type="range"] {
    padding: 0;
    border: 0;
}

.gfx-editor-field-grid output {
    color: var(--gfx-editor-primary);
    font-size: 11px;
    font-weight: 750;
}

.gfx-editor-field--wide {
    grid-column: 1 / -1;
}

.gfx-editor-check {
    display: flex !important;
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    align-items: center;
}

.gfx-editor-check input {
    width: auto;
    min-height: 0;
}

.gfx-editor-section-card {
    margin-bottom: 14px;
    padding: 15px;
    border: 1px solid #e1dbea;
    border-radius: 14px;
    background: #fbfaff;
}

.gfx-editor-section-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.gfx-editor-section-card__heading strong {
    overflow: hidden;
    color: #2a223a;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gfx-editor-media-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
}

.gfx-editor-history {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.gfx-editor-history__item {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid #e4dff0;
    border-radius: 10px;
    background: #faf9fd;
}

.gfx-editor-history__item strong {
    color: #2d2540;
    font-size: 12px;
}

.gfx-editor-history__item span {
    color: #7b7389;
    font-size: 10px;
}

@media (max-width: 600px) {
    .gfx-editor-toggle {
        right: 14px;
        bottom: 14px;
    }

    .gfx-editor-panel {
        top: 8px;
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        border-radius: 17px;
    }

    .gfx-editor-body {
        padding: 16px;
    }

    .gfx-editor-field-grid {
        grid-template-columns: 1fr;
    }

    .gfx-editor-field--wide,
    .gfx-editor-check {
        grid-column: 1;
    }
}
