.eb-fv {
    --eb-fv-bg: #ffffff;
    --eb-fv-panel: #f7f7f8;
    --eb-fv-text: #171717;
    --eb-fv-muted: #666666;
    --eb-fv-border: #e4e4e7;
    --eb-fv-dark: #171717;
    --eb-fv-radius: 22px;
    font-family: inherit;
    color: var(--eb-fv-text);
    max-width: 1240px;
    margin: 30px auto;
}

.eb-fv *, .eb-fv *::before, .eb-fv *::after {
    box-sizing: border-box;
}

.eb-fv__hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    background: var(--eb-fv-bg);
    border: 1px solid var(--eb-fv-border);
    border-radius: var(--eb-fv-radius);
    padding: 24px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .08);
    margin-bottom: 18px;
}

.eb-fv__eyebrow {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f1f2;
    color: var(--eb-fv-muted);
    font-size: 12px;
    line-height: 1;
    margin-bottom: 10px;
}

.eb-fv__hero h2 {
    margin: 0 0 8px;
    padding: 0;
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.1;
    font-weight: 800;
}

.eb-fv__hero p {
    margin: 0;
    padding: 0;
    color: var(--eb-fv-muted);
    max-width: 660px;
    line-height: 1.55;
}

.eb-fv__upload {
    position: relative;
    flex: 0 0 auto;
    cursor: pointer;
}

.eb-fv__upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.eb-fv__upload span,
.eb-fv button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    background: var(--eb-fv-dark);
    color: #ffffff;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.eb-fv__upload:hover span,
.eb-fv button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .13);
}

.eb-fv__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 18px;
}

.eb-fv__stage-wrap,
.eb-fv__panel {
    border: 1px solid var(--eb-fv-border);
    background: var(--eb-fv-bg);
    border-radius: var(--eb-fv-radius);
    box-shadow: 0 18px 55px rgba(15, 23, 42, .08);
}

.eb-fv__stage-wrap {
    padding: 14px;
}

.eb-fv__stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 520px;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(45deg, #eeeeee 25%, transparent 25%),
        linear-gradient(-45deg, #eeeeee 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eeeeee 75%),
        linear-gradient(-45deg, transparent 75%, #eeeeee 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.eb-fv__canvas {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    width: 100%;
    height: auto;
    cursor: crosshair;
    border-radius: 14px;
}

.eb-fv__empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 8px;
    padding: 30px;
    color: var(--eb-fv-muted);
}

.eb-fv__empty strong {
    color: var(--eb-fv-text);
    font-size: 22px;
}

.eb-fv.has-image .eb-fv__empty {
    display: none;
}

.eb-fv__status {
    min-height: 34px;
    color: var(--eb-fv-muted);
    font-size: 13px;
    padding: 12px 4px 0;
}

.eb-fv__panel {
    padding: 18px;
    align-self: start;
    position: sticky;
    top: 18px;
}

.eb-fv__selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--eb-fv-border);
    border-radius: 16px;
    background: var(--eb-fv-panel);
    margin-bottom: 14px;
}

.eb-fv__selected-chip {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: #e9e1d0;
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}

.eb-fv__selected small {
    display: block;
    color: var(--eb-fv-muted);
    margin-bottom: 3px;
}

.eb-fv__selected strong {
    display: block;
    font-size: 18px;
}

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

.eb-fv .eb-fv__tool,
.eb-fv .eb-fv__similar,
.eb-fv .eb-fv__clear,
.eb-fv .eb-fv__add-zone,
.eb-fv .eb-fv__download,
.eb-fv .eb-fv__reset-zones,
.eb-fv .eb-fv__zone-btn {
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--eb-fv-border);
    background: #ffffff;
    color: var(--eb-fv-text);
    box-shadow: none;
    font-size: 13px;
}

.eb-fv .eb-fv__tool.is-active,
.eb-fv .eb-fv__add-zone,
.eb-fv .eb-fv__download {
    background: var(--eb-fv-dark);
    color: #ffffff;
    border-color: var(--eb-fv-dark);
}

.eb-fv__control {
    display: grid;
    gap: 7px;
    margin: 12px 0;
    color: var(--eb-fv-muted);
    font-size: 13px;
}

.eb-fv__control input[type="range"] {
    width: 100%;
    accent-color: var(--eb-fv-dark);
}

.eb-fv__control select,
.eb-fv__search {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--eb-fv-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--eb-fv-text);
}

.eb-fv__control select {
    font-weight: 700;
}

.eb-fv__check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--eb-fv-muted);
    margin: 12px 0 14px;
}

.eb-fv__check input {
    accent-color: var(--eb-fv-dark);
}

.eb-fv__actions {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.eb-fv__actions--work {
    grid-template-columns: repeat(3, 1fr);
}

.eb-fv__actions--download {
    grid-template-columns: 1fr;
}

.eb-fv .eb-fv__download {
    min-height: 46px;
}

.eb-fv__zones-block {
    border: 1px solid var(--eb-fv-border);
    border-radius: 16px;
    background: var(--eb-fv-panel);
    padding: 12px;
    margin-bottom: 16px;
}

.eb-fv__zones-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.eb-fv__zones-head strong {
    font-size: 15px;
}

.eb-fv .eb-fv__reset-zones {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
}

.eb-fv__zones-list {
    display: grid;
    gap: 8px;
}

.eb-fv__zones-empty {
    padding: 10px 2px;
    color: var(--eb-fv-muted);
    font-size: 13px;
}

.eb-fv__zone-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid var(--eb-fv-border);
    border-radius: 14px;
}

.eb-fv__zone-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.eb-fv__zone-swatch {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, .08);
    cursor: pointer;
}

.eb-fv__zone-text {
    min-width: 0;
}

.eb-fv__zone-text strong,
.eb-fv__zone-text small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eb-fv__zone-text strong {
    font-size: 13px;
}

.eb-fv__zone-text small {
    color: var(--eb-fv-muted);
    font-size: 11px;
    margin-top: 2px;
}

.eb-fv__zone-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.eb-fv .eb-fv__zone-btn {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
}

.eb-fv .eb-fv__zone-btn--danger {
    color: #b91c1c;
}

.eb-fv__palette-head {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.eb-fv__palette-head strong {
    font-size: 15px;
}

.eb-fv__palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 450px;
    overflow: auto;
    padding: 2px 3px 2px 0;
}

.eb-fv__swatch {
    min-width: 0;
    min-height: 52px;
    border-radius: 13px;
    border: 2px solid transparent;
    display: grid;
    place-content: end center;
    padding: 7px 4px;
    font-size: 10px;
    font-weight: 800;
    color: rgba(0, 0, 0, .72);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.eb-fv__swatch.is-selected {
    border-color: #111111;
    transform: translateY(-1px);
}

@media (max-width: 980px) {
    .eb-fv__hero {
        align-items: stretch;
        flex-direction: column;
    }

    .eb-fv__layout {
        grid-template-columns: 1fr;
    }

    .eb-fv__panel {
        position: relative;
        top: auto;
    }

    .eb-fv__stage {
        min-height: 360px;
    }

    .eb-fv__palette {
        grid-template-columns: repeat(6, 1fr);
        max-height: 360px;
    }
}

@media (max-width: 560px) {
    .eb-fv {
        margin: 18px auto;
    }

    .eb-fv__hero,
    .eb-fv__panel,
    .eb-fv__stage-wrap {
        border-radius: 16px;
        padding: 14px;
    }

    .eb-fv__tools,
    .eb-fv__actions--work,
    .eb-fv__zone-actions {
        grid-template-columns: 1fr;
    }

    .eb-fv__actions--work {
        display: grid;
    }

    .eb-fv__zone-item,
    .eb-fv__zones-head {
        flex-direction: column;
        align-items: stretch;
    }

    .eb-fv__zone-actions {
        display: grid;
    }

    .eb-fv__palette {
        grid-template-columns: repeat(4, 1fr);
    }
}
