.palette-row {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-bottom: 0.7em;
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    background: #f9fafb;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, background 0.2s;
}
.palette-row:hover {
    background: #f0f6ff;
    box-shadow: var(--shadow-md);
}
.palette-color-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    transition: border 0.2s;
}
.palette-color-label {
    font-size: 1rem;
    color: var(--color-heading);
    font-family: monospace;
    padding-left: 0.2em;
    padding-right: 0.5em;
    letter-spacing: 0.5px;
}
/* Layout for k-means flex row */
.kmeans-flex-row {
    display: flex;
    flex-direction: row;
    gap: 2.5em;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 2em;
}

.kmeans-images-col {
    flex: 3 1 0;
    min-width: 0;
}

.kmeans-controls-col {
    flex: 1 1 0;
    min-width: 260px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.parameters {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.2em 1em 1.5em 1em;
    margin-bottom: 1.5em;
    border: 1px solid var(--color-border-light);
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.palette {
    margin-top: 1.5em;
    padding: 1em 0 0 0;
    border-top: 1px solid var(--color-border-light);
}

.palette h3 {
    font-size: 1.1rem;
    color: var(--color-heading);
    margin-bottom: 0.5em;
    margin-top: 0;
}

.palette-placeholder {
    color: var(--color-subheading);
    font-size: 1rem;
    text-align: center;
    padding: 0.5em 0;
}

@media (max-width: 1100px) {
    .kmeans-flex-row {
        flex-direction: column;
        gap: 1.5em;
    }

    .kmeans-controls-col {
        max-width: 100vw;
        min-width: 0;
    }
}

/* Editor page custom styles for modern look */

.editor-header {
    text-align: center;
    margin-bottom: 1.5em;
}

.editor-desc {
    color: var(--color-subheading);
    font-size: 1.08rem;
    margin-top: 0.5em;
    margin-bottom: 0;
}

.editor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1em;
    justify-content: center;
    margin-bottom: 2em;
}

.editor-op-card {
    min-width: 216px;
    max-width: 288px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.35em 1em 1em 1em;
    margin-bottom: 1.2em;
    border: 1px solid var(--color-border-light);
    transition: box-shadow 0.2s, border 0.2s;
}

.editor-op-card:hover {
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--color-primary);
}

.editor-op-title {
    font-weight: 600;
    color: var(--color-heading);
    font-size: 1.15rem;
    margin-bottom: 0.7em;
    text-align: center;
}

.editor-slider-label {
    font-size: 1rem;
    color: var(--color-subheading);
    margin-right: 0.5em;
    font-weight: 500;
}

.editor-slider {
    width: 120px;
    margin: 0 0.5em 0 0;
    accent-color: var(--color-primary);
    vertical-align: middle;
}

.editor-slider-value {
    font-size: 1rem;
    color: var(--color-heading);
    margin-left: 0.5em;
    min-width: 32px;
    display: inline-block;
    text-align: right;
}

.editor-images-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    justify-content: center;
    align-items: flex-start;
    min-height: 320px;
    background: #f8f8f8;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    margin-bottom: 2em;
    padding: 2em 1em;
    box-shadow: var(--shadow-sm);
}

.editor-img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 1em;
    border: 1px solid var(--color-border-light);
    transition: box-shadow 0.2s;
    min-width: 220px;
    max-width: 670px;
}

.editor-img-wrapper:hover {
    box-shadow: var(--shadow-md);
}

.editor-img {
    max-width: 650px;
    max-height: 650px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-border-light);
    background: #fafafa;
    box-shadow: var(--shadow-sm);
}

.editor-no-images {
    color: var(--color-subheading);
    font-size: 1.1rem;
    margin: 2em auto;
    text-align: center;
    width: 100%;
}

.editor-reset-btn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 1000;
    background: var(--color-danger);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

.editor-reset-btn:hover {
    background: var(--color-danger);
    box-shadow: var(--shadow-lg);
}

.editor-reset-img {
    width: 38px;
    height: 38px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.10));
}

@media (max-width: 900px) {
    .editor-controls {
        flex-direction: column;
        gap: 1.2em;
    }

    .editor-images-row {
        flex-direction: column;
        gap: 1.2em;
        padding: 1em 0.5em;
    }

    .editor-img-wrapper {
        min-width: 90vw;
        max-width: 98vw;
    }

    .editor-img {
        max-width: 90vw;
        max-height: 60vw;
    }
}

.box {
    width: 24px;
    height: 24px;
    border: 1px solid #999;
    margin-right: 10px;
}