.step-card {
    border: 1px solid #d2e0f6;
    box-shadow: 0 5px 18px -12px #31598c55;
}

.locked-block {
    background: #f9fafb;
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.locked-block .title {
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    font-size: 13px;
}
.locked-block .form-select {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.filter-block {
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fff;
}
.filter-block .title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
    font-size: 13px;
}
.filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: flex-end;
    width: 100%;
}
.filter-row .filter-field {
    flex: 1 1 0;
    min-width: 0;
}
.filter-row .filter-field.w-long {
    flex: 1.8 1 0;
}
.filter-row .filter-field .form-label {
    font-size: 12px;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.filter-row .filter-field .form-select,
.filter-row .filter-field .form-control {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 6px 6px;
    height: 34px;
}
.filter-row .filter-field .form-select:disabled,
.filter-row .filter-field .form-control:disabled {
    background: #f3f4f6;
    color: #000;
    cursor: not-allowed;
}

.reliability-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    align-items: flex-end;
}
.reliability-row .field {
    flex: 1 1 0;
    min-width: 0;
}
.reliability-row .field .form-label {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 4px;
}
.reliability-row .field .form-select {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 6px 4px;
}

.struct-fit-row {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}
.struct-fit-row .field {
    flex: 1 1 0;
    min-width: 0;
}
.struct-fit-row .form-label {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.struct-fit-row .form-select {
    font-size: 12px;
    padding: 6px 4px;
}

.model-select-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}

.sem-page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.sem-page-grid .model-card {
    padding: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.sem-page-grid .model-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}
.sem-page-grid .model-card .model-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    line-height: 1.4;
}
.sem-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #374151;
}
.sem-pager button { min-width: 70px; }

.var-block {
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #fff;
}
.var-block .form-label { color: #111827; }
.var-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.var-block-header .var-title {
    font-weight: 700;
    color: #111827;
    font-size: 14px;
}
.var-block-header .dim-actions {
    display: flex;
    gap: 6px;
}
.var-block-header .dim-actions .btn {
    font-size: 14px;
    padding: 6px 14px;
    line-height: 1.25;
}

.dims-row {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 4px;
    padding-bottom: 4px;
    align-items: flex-end;
}
.dim-cell {
    flex: 0 0 auto;
    width: 110px;
}
.dim-cell .form-label {
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 4px;
    color: #111827;
}
.dim-cell-score {
    flex: 0 0 auto;
    width: 110px;
}
.dim-cell-score .form-label {
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 4px;
    color: #111827;
}

.num-spin {
    display: flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 32px;
}
.num-spin .num-value {
    flex: 1;
    border: none;
    text-align: center;
    padding: 0 4px;
    font-size: 14px;
    outline: none;
    background: #fff;
    cursor: default;
    min-width: 0;
}
.num-spin .num-value::placeholder { color: #9ca3af; }
.num-spin .num-btns {
    display: flex;
    flex-direction: row;
    border-left: 1px solid #d1d5db;
}
.num-spin .num-btns button {
    flex: 1;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 12px;
    user-select: none;
    line-height: 1;
    color: #fff;
}
.num-spin .num-btns .btn-plus { background: #16a34a; }
.num-spin .num-btns .btn-plus:hover:not(:disabled) { background: #15803d; }
.num-spin .num-btns .btn-minus { background: #dc2626; }
.num-spin .num-btns .btn-minus:hover:not(:disabled) { background: #b91c1c; }
.num-spin .num-btns button:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}
.num-spin .num-btns button + button { border-left: 1px solid #fff; }

.options-row {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    align-items: flex-end;
    margin-bottom: 10px;
    padding-bottom: 4px;
}
.options-row .field {
    flex: 0 0 110px;
    min-width: 110px;
    max-width: 110px;
}
.options-row .field .form-label {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.options-row .field-wide {
    flex: 0 0 180px;
    min-width: 180px;
    max-width: 180px;
}

.dist-wrap {
    background: #fff;
    border: 1px dashed #ced4da;
    border-radius: 6px;
    padding: 8px;
    height: 220px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.dist-wrap canvas { display: block; }

.mean-spinner {
    position: relative;
    width: 100%;
    height: 32px;
}
.mean-spinner .form-control {
    padding-right: 86px;
    text-align: left;
    cursor: default;
    background: #fff;
    height: 32px;
}
.spinner-buttons {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 80px;
    display: flex;
    flex-direction: row;
    border-left: 1px solid #d1d5db;
    border-radius: 0 5px 5px 0;
    overflow: hidden;
}
.spinner-btn {
    flex: 1;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    user-select: none;
}
.spinner-plus { background: #bbf7d0; color: #166534; }
.spinner-plus:hover:not(:disabled) { background: #86efac; }
.spinner-minus { background: #fecaca; color: #991b1b; }
.spinner-minus:hover:not(:disabled) { background: #fca5a5; }
.spinner-btn:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}
.spinner-btn + .spinner-btn { border-left: 1px solid #fff; }

.periods-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    padding-bottom: 4px;
}
.period-cell {
    flex: 1 1 0;
    min-width: 170px;
    padding: 0 14px;
    border-left: 1px solid #cbd5e1;
}
.period-cell:first-child {
    border-left: none;
    padding-left: 0;
}
.period-cell:last-child { padding-right: 0; }
.period-cell-disabled {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}
.var-period-title {
    text-align: center;
    font-weight: 700;
    color: #111827;
    font-size: 13px;
    margin-bottom: 10px;
}
.var-period-title-left { text-align: left; }
.period-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.period-options .field { width: 100%; }
.period-options .field .form-label {
    font-size: 12px;
    margin-bottom: 4px;
    color: #111827;
}

.sem-page-grid .model-card:hover:not(.selected) {
    border-color: #769be0;
    box-shadow: 0 6px 20px -10px #31598c66;
}

@media (prefers-reduced-motion: no-preference) {
    .sem-page-grid .model-card {
        transition: translate 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
    }

    .sem-page-grid .model-card:hover:not(.selected) { translate: 0 -2px; }
}
