 

.bx-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bx-grid__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.bx-grid__title {
    margin: 0;
    color: var(--ws-fg);
    font: 750 15px/1.2 var(--bilox-font-display, Manrope, Inter, sans-serif);
}

.bx-grid__drop {
    border: 1px dashed transparent;
    border-radius: var(--ws-radius-md, 12px);
    transition: border-color .16s ease, background .16s ease;
}

.bx-grid__drop[data-dragging="1"] {
    border-color: var(--ws-primary);
    background: var(--ws-primary-soft);
}

.bx-grid__drop[data-dragging="1"] .bx-grid__cells {
    padding: 8px;
}

.bx-grid__cells {
    display: grid;
     
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 12px;
}

.bx-grid__cell {
    position: relative;
    display: grid;
     
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto auto;
    align-items: center;
    justify-items: stretch;
    text-align: center;
    gap: 6px;
    aspect-ratio: 1 / 1;
    padding: 12px 10px;
     
    border: 2px dashed var(--ws-line-strong);
    border-radius: var(--ws-radius-md, 12px);
    background: var(--ws-surface);
    color: var(--ws-fg-muted);
    font-family: var(--bilox-font-body, Inter, sans-serif);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .16s ease, background .16s ease, opacity .16s ease;
}

.bx-grid__cell:hover,
.bx-grid__cell:focus-visible {
    border-color: var(--ws-primary);
    background: var(--ws-primary-soft);
    outline: none;
}

.bx-grid__art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    height: 100%;
}

.bx-grid__add {
    display: inline-flex;
    width: 34px;
    height: 34px;
    opacity: .85;
}

.bx-grid__add svg { width: 100%; height: 100%; }

.bx-grid__done {
    display: inline-flex;
    width: 32px;
    height: 32px;
    color: var(--bx-grid-done, #5aa86f);
}

.bx-grid__done svg { width: 100%; height: 100%; }

body.theme-dark .bx-grid__done { color: #7fc492; }

.bx-grid__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--ws-line-strong);
    border-top-color: var(--ws-primary);
    border-radius: 50%;
    animation: bx-grid-spin .8s linear infinite;
}

@keyframes bx-grid-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .bx-grid__spinner { animation-duration: 2.4s; }
}

.bx-grid__cell[data-state="filled"] {
    border-style: solid;
    border-color: color-mix(in srgb, var(--bx-grid-done, #5aa86f) 32%, var(--ws-line));
    background: color-mix(in srgb, var(--bx-grid-done, #5aa86f) 7%, var(--ws-surface));
    color: var(--ws-fg);
    opacity: .78;
}

.bx-grid__cell[data-state="filled"]:hover,
.bx-grid__cell[data-state="filled"]:focus-visible {
    border-color: color-mix(in srgb, var(--bx-grid-done, #5aa86f) 60%, var(--ws-line));
    background: color-mix(in srgb, var(--bx-grid-done, #5aa86f) 12%, var(--ws-surface));
    opacity: 1;
}

.bx-grid__cell[data-state="busy"] {
    border-style: solid;
    border-color: var(--ws-primary);
    cursor: progress;
}

.bx-grid__cell[data-state="error"] {
    border-style: solid;
    border-color: var(--ws-accent-ruby, #c0392b);
}

.bx-grid__label {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--ws-fg);
     
    font: 800 13px/1.25 var(--bilox-font-display, Manrope, Inter, sans-serif);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bx-grid__file {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--ws-fg-muted);
    font: 600 12px/1.25 var(--bilox-font-body, Inter, sans-serif);
    white-space: nowrap;
}

.bx-grid__swap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ws-primary);
    opacity: 0;
    transition: opacity .14s ease;
    pointer-events: none;
}

.bx-grid__swap svg {
    width: 26px;
    height: 26px;
}

.bx-grid__swap-text {
    font: 800 12px/1 var(--bilox-font-display, Manrope, Inter, sans-serif);
}

.bx-grid__cell[data-state="filled"]:hover .bx-grid__swap,
.bx-grid__cell[data-state="filled"]:focus-visible .bx-grid__swap {
    opacity: 1;
}

.bx-grid__cells:not([data-locked="1"]) .bx-grid__cell[data-state="filled"]:hover .bx-grid__done,
.bx-grid__cells:not([data-locked="1"]) .bx-grid__cell[data-state="filled"]:focus-visible .bx-grid__done {
    opacity: 0;
}

.bx-grid__done {
    transition: opacity .14s ease;
}

@media (prefers-reduced-motion: reduce) {
    .bx-grid__swap,
    .bx-grid__done { transition: none; }
}

.bx-grid__clear {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--ws-surface-strong, var(--ws-surface));
    box-shadow: var(--ws-shadow-sm, 0 2px 6px rgba(0, 0, 0, .12));
    color: var(--ws-fg-muted);
    cursor: pointer;
}

.bx-grid__clear svg { width: 13px; height: 13px; }

.bx-grid__cell[data-state="filled"]:hover .bx-grid__clear,
.bx-grid__cell[data-state="filled"]:focus-within .bx-grid__clear {
    display: inline-flex;
}

.bx-grid__cells[data-locked="1"] {
    opacity: .55;
}

.bx-grid__cells[data-locked="1"] .bx-grid__cell {
    cursor: not-allowed;
}

.bx-grid__cells[data-locked="1"] .bx-grid__cell:hover {
    border-color: var(--ws-line-strong);
    background: var(--ws-surface);
}

.bx-grid__note {
    margin: 0;
    color: var(--ws-fg-muted);
    font-family: var(--bilox-font-body, Inter, sans-serif);
    font-size: 13px;
    line-height: 1.5;
}

.bx-grid__hint {
    margin: 0;
    color: var(--ws-fg);
    font-family: var(--bilox-font-body, Inter, sans-serif);
    font-size: 13px;
    line-height: 1.5;
}

.bx-grid__error {
    margin: 0;
    color: var(--ws-accent-ruby, #c0392b);
    font: 600 13px/1.5 var(--bilox-font-body, Inter, sans-serif);
}

@media (max-width: 520px) {
    .bx-grid__cells { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
}
